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

put events while offline never get synced #1378

Open
eyaler opened this issue Jun 23, 2024 · 0 comments
Open

put events while offline never get synced #1378

eyaler opened this issue Jun 23, 2024 · 0 comments

Comments

@eyaler
Copy link

eyaler commented Jun 23, 2024

Code to recreate - based on basic/note example:

const peers = ['https://gun-manhattan.herokuapp.com/gun', 'https://try.axe.eco/gun', 'https://test.era.eco/gun']
const gun = Gun(peers)
const pad = gun.get(location.hash.slice(1) || 'default')
addEventListener('online', () => {gun.opt(peers); pad.get('heartbeat').put('heartbeat')})
textarea.addEventListener('input', () => pad.put({content: textarea.value}))
pad.on(data => textarea.value = data.content)

The line with the online event reconnects the gun and the heartbeat allows the reconnected client to receive the missed "on" events.

However, the put events that happened in the offline client never get synced (even if these were the only events in the network). In this state the graphs are not consistent, and I could not find a way to explicitly check the sync status/diff or force the sync in this direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant