#You can only unload a record that is not inflight

1 messages · Page 1 of 1 (latest)

devout grove
#

I've currently got an issue where my test fails because a record is apparantly inflight, I've checked to see if any records have dirty state but that does not seem to be the case. I'm not sure what else the issue could be here? Anybody have any idea, full error message below. Promise rejected after "try the csv parse component updating existing booking registrations": Assertion Failed: You can only unload a record which is not inFlight. <booking-registration:785707>@ 1298 ms
Source:
Error: Assertion Failed: You can only unload a record which is not inFlight. <booking-registration:785707>
at Object.assert (http://localhost:4202/assets/test-support-3bb56102661472f8295483ebb04ce7b4.js:283:15)
at Object.assertAgainstUnloadRecord [as unloadRecord] (http://localhost:4202/assets/vendor-d7d1260f0abab8670b4ba6d3aa7c2209.js:91856:12)
at InternalModel.send (http://localhost:4202/assets/vendor-d7d1260f0abab8670b4ba6d3aa7c2209.js:92730:32)
at InternalModel.unloadRecord (http://localhost:4202/assets/vendor-d7d1260f0abab8670b4ba6d3aa7c2209.js:92415:12)
at InternalModelMap.clear (http://localhost:4202/assets/vendor-d7d1260f0abab8670b4ba6d3aa7c2209.js:89215:23)
at IdentityMap.clear (http://localhost:4202/assets/vendor-d7d1260f0abab8670b4ba6d3aa7c2209.js:89262:18)
at InternalModelFactory.clear (http://localhost:4202/assets/vendor-d7d1260f0abab8670b4ba6d3aa7c2209.js:89539:27)
at Store.unloadAll (http://localhost:4202/assets/vendor-d7d1260f0abab8670b4ba6d3aa7c2209.js:95618:17)
at Store.willDestroy (http://localhost:4202/assets/vendor-d7d1260f0abab8670b4ba6d3aa7c2209.js:96564:12)
at http://localhost:4202/assets/vendor-d7d1260f0abab8670b4ba6d3aa7c2209.js:31176:68

pseudo girder
#

Is it just a problem during testing or also when you use the application? I’m wondering if there’s something that’s advancing to unloadAll too early or something

devout grove
pseudo girder
#

Ok, a bit of a guess but you might need to make sure your test waits for all promises to be settled before it goes to the step that unloads the records

#

The test helpers like click and visit do that already, but it might be necessary if you’re triggering an event another way

#

Or, it could be that a promise isn’t getting tracked by ember but that seems less likely since you’re already using Ember Data