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

Mark all conversations as read #11

Open
grvn-ht opened this issue Apr 10, 2024 · 8 comments
Open

Mark all conversations as read #11

grvn-ht opened this issue Apr 10, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@grvn-ht
Copy link

grvn-ht commented Apr 10, 2024

I would like to mark all messages as read (otherwise when people get to their new account they will push button "mark all as read" and it makes synapse server very slow, lots of timeout ... then it is unusable for some time
What happens is that synapse /receipt endpoint get flooded by requests and can't process all requests at same time,
Solutions for this could be to implement general synapse workers for this endpoint:
https://matrix-org.github.io/synapse/latest/workers.html#available-worker-applications
But we would need to implement a reverse proxy in front of synapse to redirect specific requests to the worker.

Anyway I don't think it's a good solution, because it would only be used a few days, until all users get all conversations as read.

Other solution is to mark messages as read when we publish them in synapse.
When Room is full, we need to do a request for each user of the room with last event like:
curl --request POST
--url https://HOMESERVER_NAME/_matrix/client/v3/rooms/ROOM_ID/receipt/m.read/LAST_EVENT_ID
--header 'Authorization: Bearer USER_TOKEN'
--header 'Content-Type: application/json'
--data '{"thread_id": "main"}'

@grvn-ht
Copy link
Author

grvn-ht commented Apr 11, 2024

#14
I don't handle thread and user that do migration for now

@HerHde
Copy link
Collaborator

HerHde commented Jun 17, 2024

Have a look if the current main branch fulfils your needs, and if so, we can close [this]

@HerHde HerHde added the enhancement New feature or request label Jun 17, 2024
@grvn-ht
Copy link
Author

grvn-ht commented Jun 24, 2024

Hi @HerHde,
Thanks for re-working the code :)
but if i understand correctly you don't handle read last message from all threads
you can find my solution here on src/handlers/markAllAsRead.ts
https://github.com/grvn-ht/rocketchat2matrix/tree/migration
but to do this i need to re-parse messages file
do you think of another option without it?

@HerHde
Copy link
Collaborator

HerHde commented Jun 25, 2024

I need to write some test data for it and see, if I can find a solution for threads (if they are not marked as read). Your branch migration contains a lot of unrelated changes, so I need time to look into it.

And I think there must be a way to request the unread threads from Synapse.

@grvn-ht
Copy link
Author

grvn-ht commented Jun 27, 2024

Yes it was a branch where i did lots of test,
this one have less changes, more clear
https://github.com/grvn-ht/rocketchat2matrix/tree/migration-end

@HerHde
Copy link
Collaborator

HerHde commented Jul 2, 2024

Well, I found an API endpoint which provides all threads in a room, so I'll rather focus on that. Thank you anyhow and sorry I can't make anything of your latest contribution, so far.

@HerHde
Copy link
Collaborator

HerHde commented Jul 2, 2024

I have basically tested all the necessary API endpoints, but just to ask before implementing something:

With the current version of the script, how does it look (for example in Element with a screenshot) if you have unread threads? My test data doesn't show any unread messages with the latest code change.

@HerHde
Copy link
Collaborator

HerHde commented Jul 25, 2024

Again the question to everyone: Does this problem still persist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants