You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.
This is an edge case for me, but I have a case where a user model is used for login and that is sent up to the server. I'd like to not have the user's password in the localstorage after the login, so I can easily go in and do a:
user.save({password:null}, {remote:false})
Which is fine, but then there is a dirty user record sitting out there, that will never be saved to the server. It would be better if I could specify a local change with a remote:'never' or some other option and then have that change never go into the dirty (or destroyed) queues for later syncing.
(Now that I'm typing this, I think I just realized I need to do a custom parse maybe so that I can blank out that password before local save - so this might be a nonsensical case - but its an idea nonetheless.)
The text was updated successfully, but these errors were encountered:
I had also said this, which you have just shown me was an incorrect assumption:
I don't believe we need any mode that uses local storage does not mark records dirty.
Accounting for that, what do you think about having a storageMode option with these options? I'm open to suggestions on the option names. Do they make the behavior obvious?
storageMode: mode # one of: ['dual' (default), 'offline', 'remote-only', 'local-only']
I think those work ok. I can't think of a reason why I would use remote-only right now, but it makes sense for completeness. I think the names work fine if their use is documented.
I'm not sure I understand what offline is for?
I'm a little bit confused - would these used in conjunction with the "remote: false" or as a replacement? If a replacement, then I agree this is a better system - providing the decision can be made broadly at the model AND at the individual record save.
Again, I'm dealing with a weird edge case, so I hate to pollute the pool with that. But if there are other uses then making sure to have a local-only for completeness would help my case.
I will document the options regardless, but I hope to make the option names make sense without having to refer to documentation.
These would replace both the local and remote options. storageMode: 'offline' would be equivalent to how remote: false acts now: it skips the online step, makes the changes locally, and marks the records dirty. Does this table make it clear?
This is an edge case for me, but I have a case where a user model is used for login and that is sent up to the server. I'd like to not have the user's password in the localstorage after the login, so I can easily go in and do a:
Which is fine, but then there is a dirty user record sitting out there, that will never be saved to the server. It would be better if I could specify a local change with a remote:'never' or some other option and then have that change never go into the dirty (or destroyed) queues for later syncing.
(Now that I'm typing this, I think I just realized I need to do a custom parse maybe so that I can blank out that password before local save - so this might be a nonsensical case - but its an idea nonetheless.)
The text was updated successfully, but these errors were encountered: