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

Invalid op submitted. Op version newer than current snapshot #654

Closed
PodviaznikovPavlo opened this issue May 15, 2024 · 4 comments
Closed

Comments

@PodviaznikovPavlo
Copy link

hi guys.

i'm facing with this error: Invalid op submitted. Op version newer than current snapshot

The error itself is ok, i understand why i get it. The question is: how to catch this error?

Currently i see that submit-request.js logs it to console. But i want to catch this error and log it. I've checked available middleware and also tried to add .on('error') listened to new ShareDB instance. But i cannot catch it.

The only place where i get it is client. But i need to catch it in nodejs. Any thoughts?

image
@alecgibson
Copy link
Collaborator

You shouldn't be hitting this error. Are you manually submitting or deleting ops (outside of ShareDB)?

@PodviaznikovPavlo
Copy link
Author

PodviaznikovPavlo commented May 15, 2024

yes. i opened another issue where we discussed that years ago.

we have complex system and we sometimes get this error. but as i said, it is okay and i understand why we have it. unfortunately, our current approach doesn't allow to let ONLY sharedb modify data in the DB.

so, for now i want at least to be able to catch this error and log it, to gather info on how often customers face this error.

@alecgibson
Copy link
Collaborator

If your aim is to just log the error server-side, the simplest thing is probably to listen for submitRequestEnd, which is emitted with the request's error (if any).

@PodviaznikovPavlo
Copy link
Author

great. thanks!

i just tried it and was able to catch the error. that's all i need. thanks!

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

2 participants