Comments (16)
from data.
@pixelcort Honestly, I can't see how this would ever be a common case. Once something is deleted, it's gone. I can't see that you'd ever want to resurrect an actually deleted item. If you want "Trash Can" like functionality, then you should implement separately from deletion.
from data.
That's too bad. On my current ember app and the last few SC apps, all three APIs had cases where things deleted would come back.
Once again, I would have closed this issue which I opened myself, but apparently it was closed for me. I can't believe it's normal on GitHub for issues to be closed by anyone other than the person who opened them.
from data.
The common case are types of things that have composited ids derived from other things. Conceptually you can think of them deleted, but then later when someone else creates an identical thing, that new thing coincidentally has the same id due to the id being derived from its data.
from data.
Perhaps instead of undelete, a better explanation is, after something is deleted, something new is made that coincidentally has the same id.
from data.
@pixelcort That explanation makes a bit more sense, I'll reopen for @tomdale and @wycats to review.
As for closing tickets, I'm an admin on this project so I take it that I'm in a position to close tickets. Whenever I close tickets, I always review any additional responses and will reopen if a good argument is put forth.
from data.
I should say however that it seems very odd for the same ids to be reused, even for similar/identical data. I would recommend changing the API over us changing ember-data.
from data.
Crap, that close was accidental.
from data.
Yeah one example is a User - Subscriber - Chatroom relationship, where Subscriber id is the composite of the user name and the chatroom name. To unsubscribe from a chatroom, the app would send a DELETE /subscriber/pixelcort-cats . Later, if I were to re-join that cats chatroom, the server would create a new subscriber object with the same 'pixelcort-cats' id.
As more servers move to NoSQL-based databases, I think we're going to see more cases where ids are not going to be serially incrementing integers.
@wagenet , sorry about getting upset about the ticket closing; I'm still getting used to GitHub etiquette and came from a place with different cultural beliefs about who was expected to close tickets.
from data.
@pixelcort Sorry to cause offense. I hope it makes a little more sense now. I try to stay aggressive on closing tickets otherwise too many build up and it's hard to track them all. Anyway, I'm leaving this one for Tom and Yehuda to discuss.
from data.
One approach for us to use would be to totally remove a record from the store once it has been marked by the server as confirmed deleted. Would this work for you?
from data.
@wycats that should work; as the new instances that come in later on would get put into various DS.AdapterPopulatedModelArray
s.
from data.
Hi,
one other use case for resurrecting a deleted item is when there is a conflict on commit. In the case of somebody else modified the record just before i commit the deleted record, the server will reject the commit with a conflict flag. Sometimes, the right thing to do will be to put back the record because the update made by an other user make the delete action invalid. I need to move the record from state "deleted.inFlight" to "loaded.saved" and repopulate the modelarrays. I got <DS.StateManager:ember555> could not respond to event didChangeData in state rootState.deleted.inFlight.
if I try to update the deleted record...
from data.
@wycats do we remove the record from the store now?
from data.
@wagenet I think this is the purpose of unloading records #200
from data.
So I believe unload fixes this, and this hasn't been active for a while so closing.
from data.
Related Issues (20)
- bug: Setting hasMany relationship IDs to an array with duplicate IDs should error HOT 1
- return type of peekRequest is incorrect in the api docs
- is there a design flaw in request lifetimes? HOT 9
- design issue: fetch handler doesn't provide response on error HOT 3
- bug: typescript error when using computed properties in conditionals HOT 1
- bug: async-to-async relationships may error when using `unloadAll` on both types HOT 12
- Preloading polymorphic relationship breaks on ember-data 5.3 HOT 2
- Feat - Additional Functionality Support in RequestManager for handler for Dynamic Handling beyond 'request' HOT 3
- Broken link in JSON Api ReadMe HOT 1
- cache.rollbackRelationships does not rollback the 2nd time after adding a record and rollback again HOT 3
- Understanding polymorphism HOT 2
- Assertion after saving a new relational record and tried to forget it HOT 4
- [3.28->4.7] `isLoaded` does not recompute if checked before the record has loaded. HOT 6
- Error `Could not find module `@warp-drive/core-types/request` imported from `(require)`` after update to 5.3.1 HOT 15
- ember-data date transform: triggering change on record re-insertion HOT 6
- bug: not tracking changes to empty relationship in 5.3.1+
- Breaks yarn install on Windows HOT 4
- Build broken after update from `5.3.0` to `5.3.3` HOT 3
- Deprecations will fire spuriously under strict ES module builds HOT 4
- Attributes with defaultValue functions not persisting HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from data.