Help with charm and lyra
Lyra is supposed to be the source of truth so how would I go about using charm-sync with lyra since atoms can be modified from anywhere and wont that make lyra not the source of truth
85 Replies
idk if this is a stupid question but idk
dont bully me for using lyra :pls:
haha look at him, hes using lyra
:spanishkek:
:HAHHAHAHA:
so the problem is that, charm was supposed to be the source of truth too
:hmm:
so you've got a conflict there
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
but then what happens when someone modifies the atom
lyra is no longer in sync
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
yeah
so i gotta ditch charm or smth
:Sadge:
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
huh
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
how do that
me noob at charm
š
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
:grubnote:
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
yeah ik
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
but what it atoms get updated somewhere else
do i just write a note to myself not to do that
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
so just use like readonly atoms somehow
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
like
as like an example
return*
@PepeElToro41 do you have any other ideas or nah
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
I would not manipulate the player atom at all
and just use lyra callbacks entirely to update the charm state
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
I did but like still kinda confused
kk
if you want to modify the money, you'd use lyra transactions or something
idk how it works
but yeah everything from lyra
or a better one, dont use lyra
:jukes:
:imsad:
I just use document-service to retrieve/save my data
would just a custom impl of smth similar to charm work
since im only using it for the sync part
:shrug:
the data is ignored entirely after that
probably not
I think it would be easier to reconcile the atom
how do you do that
than reconciling the client
can you give me an example pls

changedCallbacks
what does reconcile atom mean sorry im really slow :stare:
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
Im trying to find what are those "changedCallbacks"
lyra documentation is confusing
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
aaaaa
hated that
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View

Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
here it is in the api part of the docs
isnt that the idea
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
aaaaa
yeah idk then, delete your project or something
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
no wonder why your code is breaking :dead:
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
yall lowk confusing me frfr
ima just go uhh use charm
:yeah:
yeah this is so easy :sunglas:

Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
is this good
the
... is for discord character limitUnknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
uhh kk
Is that like a package I need to download
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
lyra is fine I just bullied him
I dont use lyra
mostly because I think my datastore library is the last thing I want to be the source of truth
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
it just doesnt align with my workflow currently
and I dont think it ever will
not saying I wouldnt use it
but its always the main drawback
if I use jecs I want to keep everything in the world
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
if I use charm/reflex, I want to keep mutations strictly with dispatchers
so my code is more predictable
no
if a server fails its just not gonna save the progress since last save
I dont think its a big deal
if the autosave is every minute, its just a minute of progress
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
thats why you process those differently
and/or force a save before confirming the purchase
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
:hii:
hi guys
im back
:catsmile:
lemme read all of this rq
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
same
thats why im using it
I think i might just not use charm for playerdata
and just sync the data manually
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
basically
so just manually syncing would be way simpler
but ima use charm for other state just not player data
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
ig
:shrug:
but then what happens when i update the data in the atom
this is what i currently have
it syncs both ways
but like what do i do if the update fails for lyra do i revert the atom in the subscribe
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
mergeDeep /= dispatchers
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
at all
at that point just send the new data to the client entirely
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
its not the same as dispatchers, you cant do mergedeep because it will clone things you dont want to
Im not saying transactions are useful
but the way I see it, datastores are asyncronous, error prone, hard to work with
which is both the main reason why you would want them as the source of truth, so no dupes or unsaves progress
but at the same time its why its a terrible idea to make this the source of truth in code
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View
again, its not how I approach state
if you find transactions useful sure
but now specially using jecs
good luck syncing an entire inventory with lyra
I should rename this to lyra discussion
š
Unknown Userā¢4mo ago
Message Not Public
Sign In & Join Server To View