Skip to content
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

feature request: keep state on last seen messages #313

Closed
Peter4825 opened this issue Aug 28, 2020 · 3 comments · Fixed by #368
Closed

feature request: keep state on last seen messages #313

Peter4825 opened this issue Aug 28, 2020 · 3 comments · Fixed by #368

Comments

@Peter4825
Copy link
Contributor

When disconnected from matterircd, messages may still pour in. When reconnecting to matterircd, it would make sense for matterircd to replay all messages that have been missed in the meanwhile.

Matterircd currently replays some messages, but this may be incomplete - when we've been offline for more then a few messages there might be a gap, or might have duplicates: messages we've already seen might be shown again

It would make sense for matterircd to optionally keep state, ie a file with the contents user X on server Y protocol Z has seen messages until timestamp 999999 so matterircd could replay exactly what has been missing...

@hloeung
Copy link
Collaborator

hloeung commented Dec 12, 2020

Matterircd currently replays some messages, but this may be incomplete - when we've been offline for more then a few messages there might be a gap, or might have duplicates: messages we've already seen might be shown again

Likely something is updating the Mattermost channel viewed (updateat?) which matterircd uses to replay old messages. This is why there might be gaps. As for duplicates, that's likely because #245 (comment)

I have a PR open to keep an internal state on what we've seen. It doesn't yet make it persistent dumping out to disk (and load) so is lost on matterircd restarts.

Feedback and additional testing welcome!

hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
@hloeung
Copy link
Collaborator

hloeung commented Jan 10, 2021

#368

hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
hloeung added a commit to hloeung/matterircd that referenced this issue Jan 10, 2021
This ensures we only replay backlog for what we haven't seen.
42wim added a commit that referenced this issue Jan 14, 2021
* Add prefix showing messages are replies to threads when using Mattermost ThreadContext

* Save lastViewedAt and load on start up (#313)

This ensures we only replay backlog for what we haven't seen.

* Use LastViewedStateSavedTime rather than town-square when working out if saved info file is stale or too old

* Only update last viewed for channels with messages since

* Make it show human readable time

* Update last viewed for channels when adding and removing events

* Fixed based on review, make these Debug as they're already resurfaced

* Make config LastViewedSaveFile. Also make format and stale duration constant per review

* Update mm-go-irckit/userbridge.go

Co-authored-by: Wim <wim@42.be>

* Update mm-go-irckit/userbridge.go

Co-authored-by: Wim <wim@42.be>

* Fixed

* Update mm-go-irckit/userbridge.go

Co-authored-by: Wim <wim@42.be>

* Fixed logic around determining stale duration

* Refactor and reduce duplicate code

* Refactor further reducing code duplication, based on review

* Save LastViewedAt also on the messages sent

* Update LastViewedAt on reactions too

* Fixed panic, fallout from recent refactor

* Reorder grouping mutex, mutex hat

* More human friendly time

Co-authored-by: Wim <wim@42.be>
@42wim
Copy link
Owner

42wim commented Jan 14, 2021

Fixed by @hloeung

@42wim 42wim closed this as completed Jan 14, 2021
hloeung added a commit to hloeung/matterircd that referenced this issue Jun 27, 2021
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.
hloeung added a commit to hloeung/matterircd that referenced this issue Jun 27, 2021
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.
hloeung added a commit to hloeung/matterircd that referenced this issue Jun 27, 2021
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.
42wim pushed a commit that referenced this issue Nov 11, 2021
…425)

Persistent last viewed at state was added in PR #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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants