14 Replies
deep-jade•2mo ago
randomness e.g. Math.random or crypto.randomUUID
absent-sapphireOP•2mo ago
how can i do that tried got rolledback
doing that doesnt work either
i want to modify the id
deep-jade•2mo ago
what collection type are you using?
absent-sapphireOP•2mo ago
live
querycollection
sorry
deep-jade•2mo ago
if you're going to do a direct write, you also need to return
{ refetch: false }
as by default it refetches your collectionabsent-sapphireOP•2mo ago
i do return a refresh: false
return in the mutationFn ?
it doesnt work either
deep-jade•2mo ago
oh sorry, yeah in a action it doesn't refetch automatically
why aren't you using onInsert and just letting it refresh?
absent-sapphireOP•2mo ago
too slow with a bad network
from the transaction object i cant modify the id ?
ok the insert work just query doesnt refresh
@Kyle Mathews
the query doesnt refresh on the writeinsert
return an undefined
the query is returning undefined on tried
even when i refresh the app the query doesnt retrieve the tried object, even though it is in the collection
deep-jade•2mo ago
are you on the latest release of tanstack db?
absent-sapphireOP•2mo ago
yes
deep-jade•2mo ago
perhaps it's just your query that's wrong then
absent-sapphireOP•2mo ago
idk how can it be wrong sometimes it work sometimes not
i dont understand
the productId is 8 and theres a tried item with a productId of 8
the userId is 1 and 1 on the tried object
if i remove the where statement it doesnt work either
the product is never undefined
brands neither
deep-jade•2mo ago
perhpas just have a debug query which is querying the whole collection and then logging that to the console?
absent-sapphireOP•2mo ago
trieds collection
products collection
when i put the same id in the insert in mutation and in the writeInsert in mutationFn that works fine
nah it doesnt work
that subquery is messing with the query