-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Properly warn when an updated record has a null id #4544
Conversation
…ord has a null id
@runspired do you have time to add a test for this usecase? |
hard to tell from the diff, but how does moving the assertions fix the error? |
@fivetanley the original location was not guarded. Any of three different request types could be returning data to this function with a null id. For all three request types, there are in fact situations in which it was previously acceptable to have a null ID.
In addition to the above fixes, there's additional reports (both at LI and on Slack) of records returning IDs and still erroring out on this assertion. This makes me suspect that either something was previously broken here that we only now see, or that something else broke between 2.7 and 2.8 which this assertion happens to catch. P.S. do we have a good testing pattern for "this should warn"? (seeing as warn is not "throw") |
It would be great to have some more examples of what payloads are triggering these kind of errors in people's apps. We just want to be very careful introducing any semantics with IDs. |
There is data/tests/integration/inverse-test.js Line 132 in 3e32efe
|
I'm also in favor of reverting #4541 until we can work out all the semantics here. |
Oops, meant #4408 |
After digging into this more, I think I'm narrowing in on having asserted the correct things and found the edge cases we were missing. One thing to note that in investigating LI's failed tests, I discovered we were often using |
Closing in favor of a different PR |
WIP, I believe this fixes but I'm running our test suite against the sha now. Will update when complete.