-
Notifications
You must be signed in to change notification settings - Fork 351
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
Horizon should be able to update a document that has not been created by horizon #569
Comments
I'm having the same problem, here's an image of the stack trace if it's helpful: This feels like a significant issue for a app server fronting a real-time database (where having multiple clients is probably a common feature). I hope we can see this turned around quickly. If I were a bit deeper in the codebase I'd try and help with a PR but I'm not there yet. |
To make matters worse, this error signals a "disconnect" from the database. In my case my app will immediately attempt a re-connection which then I guess must retry the failing query. This repeats until the browser runs out of memory / tab crashes: The stack trace for subsequent errors are interestingly non-titled (aka, "undefined") and stack traces look a bit different on exit but as you go down the stack you see the same sequence originating: |
ping @Tryneus , and I'll open a new issue for the client side problem of nulling out error messages since that seems unrelated to this particular error |
I just ran into this error as well.
What is the |
@thurt It's used to detect when a Horizon document changes between reading it and rewriting it. If you insert a new document via ReQL, it's save to set the If you modify an existing document through ReQL, I recommend also incrementing the |
@danielmewes thank you for the explanation! it sounds like a simple kind of revision control. Does this mean the value of I will try to start poking around the code base some more. Is there a place I can look to understand this behavior? |
Yes.
@Tryneus ^^^^^ |
@danielmewes Is it by design that horizon refuses to touch documents without a version field? If it is then maybe there could be an option to make horizon add the field on demand? |
@alf No, we are planning to add a default handler so that documents without version fields can still be updated through Horizon. That's why we're keeping this issue open. |
If you're reporting a bug please include the following:
If you create a document using the rethinkdb admin interface and then try to update that document using horizon, you get hit by the following error message:
socket.js:62 Uncaught Error: Object field '$hz_v$' may not be undefined
.If you update the document using the rethinkdb admin interface and add the '$hz_v$' field with a numeric value, the problem goes away.
I would prefer it if horizon would add the field if missing instead of refusing to change the document.
The text was updated successfully, but these errors were encountered: