-
Notifications
You must be signed in to change notification settings - Fork 10
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
Goto within list #50
Goto within list #50
Conversation
d034f20
to
efc7f83
Compare
More complicated to support being able to disable it for other traversal methods (such as BookmarkList traversal). If requested, this support can be added later.
40cdd85
to
a4d3ece
Compare
Made a modification to store away the per-list last visited bookmark to storage so its persistent. What's the strategy here when we want to update the database schema more in the future to potentially hold more state? |
Maybe just get all bookmarks in the active list from db then do the comparison with the last visited date field in the memory? |
4b285b7
to
b531e92
Compare
Yeah... Currently only make a breaking change, so I prefer keep the schema stable unless we have very strong reason to add a new state to db... |
Haha yeah, I completely missed I can find the latest visited by the already exposed visited date 💀 |
b531e92
to
b7a6833
Compare
Implementation fixed, no breaking changes anymore, verified locally traversing as expected. |
b7a6833
to
148a839
Compare
Text could be misinterpreted as ordering by ID, and not by 'order id'. Clean up documentation, and use 'visited at' to find the last visited in the bookmark list.
148a839
to
c05e2d0
Compare
Visited at is not sufficient for fast goto since it is being updated on seconds frequency at the minimum.
I noticed when working on some other project that the goto was.. intermittently laggy. It wasn't as snappy as the previous goto implementation. Turns out last visited uses os.time() which increases at per-second rate and this messed up the last visited selection. This works fixed the issue and now we are snappy again |
Wonderful! |
Resolves #48
Implements wrap-around supported goto next/previous within the same active BookmarkList by order id.
This feature requires keeping track of some transient working state (last visited bookmark within the same list) which I've kept in a context table in Service. I assume here that Repo is used for data that would be stored persistently, which is I thought it is appropriate to put in in Service. If there's a better place, let me know.