-
Notifications
You must be signed in to change notification settings - Fork 60
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
Support saving last viewed at state for multiple users #425
Support saving last viewed at state for multiple users #425
Conversation
I'm thinking that putting the info in 1 file instead of a file for each user is cleaner? WDYT ? |
But then it would have to keep a global data structure instead of in NewUserBridge() and synchronize between the go routines when writing / saving the state file, IIUC. |
I don't think it's a good idea to have multiple state files, we can do this in one file :-) But as we're putting more stuff on disk what do you think about using boltdb as k/v store for this instead. You can instantiate one global writer so you don't need to do the locking yourself. |
Ah sure, I'll take a look at boltdb or something similar so that state files for multiple users are all contained within the one file on disk. |
9c93ffb
to
26c73ba
Compare
Persistent last viewed at state was added in PR 42wim#313. It is done by dumping out the state of the current user to a file on disk. Unfortunately, this is only per user, the current user, even though matterircd supports multiple users. This fixes that by switching to using bbolt for storing and saving the last viewed at state.
26c73ba
to
ff08c53
Compare
@42wim , converted to using Bolt. It's also backwards compatible loading the existing values and then cleaning it up:
|
dd62397
to
ff08c53
Compare
…iewed-multi-users
Seems I overlooked this PR :( |
Thank you @42wim ! |
matterircd supports multiple users so we save separate last viewed at state files for each user. We also only load them after a user has logged in rather than on start up.