Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates that are sent for temporary branches are repeatedly sent #491

Open
KallynGowdy opened this issue Jun 28, 2024 · 7 comments
Open
Labels
area:runtime Is related to the CasualOS runtime. (Everything in aux-runtime, aux-common, aux-vm, etc.) enhancement New feature or request

Comments

@KallynGowdy
Copy link
Member

In InstRecordsClient, updates that are added to temporary branches are added to _sentUpdates, but are never actually acknowledged via the handler for repo/updates_received events.

@KallynGowdy KallynGowdy self-assigned this Jun 28, 2024
@KallynGowdy KallynGowdy converted this from a draft issue Jun 28, 2024
@KallynGowdy KallynGowdy added bug Something isn't working area:runtime Is related to the CasualOS runtime. (Everything in aux-runtime, aux-common, aux-vm, etc.) labels Jun 28, 2024
@KallynGowdy KallynGowdy moved this from Backlog to In progress in CasualOS Jul 1, 2024
@KallynGowdy
Copy link
Member Author

Ok, so the updates are kept for a valid reason, which is that temporary branches are deleted by the server once all clients disconnect from it. This means that if a client loses connection, then the server may (or may not) delete the updates, while the client keeps them. Upon reconnect, the client needs to re-upload the updates that it has in order to ensure that everything is synced.

This means that we can't simply erase sent updates for the temporary branches, but we could try implementing a smarter version of document syncing. The server could include some state vector information in the initial update after the branch is watched. This would enable the client to build an update that is optimized for updating the server to the latest version that the client has. It would additionally allow the client to skip storing updates and instead rely on the original documents themselves.

@kc9zyz
Copy link

kc9zyz commented Jul 1, 2024

Is there a way to specify things that I really don't care about being held onto? The use-case I'm working with now is the communication of the AR user in 3d space over to other listening clients via a frustum. If that data is lost when the client is disconnected, that is totally fine, as it will push new position information on reconnect.

@KallynGowdy
Copy link
Member Author

@kc9zyz You could try using sendRemoteData(). The messaging system behind it is exactly the same as tag updates, you just have complete control over what is being sent and how the result is handled.

In the future I expect temp branches (tempShared and remoteTempShared spaces) to handle this sort of scenario in a better way, but for now sendRemoteData() would be a better option.

@KallynGowdy KallynGowdy moved this from In progress to Backlog in CasualOS Jul 1, 2024
@kc9zyz
Copy link

kc9zyz commented Jul 1, 2024

@KallynGowdy that is working perfectly for me! Thanks! I am seeing plenty of these messages now when I try and update a mask or a tag on a temp bot - any ideas? It is filling up the console and I'm concerned that it may mean I'm doing something else wrong.
[AuxHelper] No partition for event {type: 'update_bot',

@KallynGowdy
Copy link
Member Author

@kc9zyz That can happen if you have a bot that was created in a space that isn't supported. For example, the temp space isn't actually supported by CasualOS. Instead, the tempLocal space is.

@kc9zyz
Copy link

kc9zyz commented Jul 1, 2024

🤦 That fixed it. Thanks again for your help! Everything is running much smoother now.

@KallynGowdy KallynGowdy added enhancement New feature or request and removed bug Something isn't working labels Jul 9, 2024
@KallynGowdy
Copy link
Member Author

Deprioritizing since this is intentional behavior and improvements would be to make it more efficient.

@KallynGowdy KallynGowdy removed their assignment Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:runtime Is related to the CasualOS runtime. (Everything in aux-runtime, aux-common, aux-vm, etc.) enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

2 participants