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

Failed to load history images cannot be reread #176

Closed
christianlupus opened this issue May 5, 2020 · 6 comments
Closed

Failed to load history images cannot be reread #176

christianlupus opened this issue May 5, 2020 · 6 comments

Comments

@christianlupus
Copy link

When you have an existing communication in WhatsApp that is older and you open a bridge (with open od pm), the bridge tries to synchronize the last few messages with the matrix room.

In my case, I had a wanky phone connection during this sync and the media could not be synchronized. I know this issue from the regular use of the web interface that images are not loading successfully on some WiFis. I need to change the connection and soon after the images are loadable. All right.

The problem in the matrix context is that history seems to be filled only once. So as soon as the history is filled, no further attempts to reread it are made. I have no way to get the bridge to drop the already read history and create a completely new room. If I leave and open again, I get the old room id.

Therefore I pledge for a command of the bridge bot user to remove the user from the room and create a completely new room with a certain (user-specifiable) amount of history read from the WhatsApp server.

For those interested in some technical details, I pushed this gist. I mainly removed the contents of the messages and the phone numbers as the chat was confidential.

@tulir
Copy link
Member

tulir commented Jun 30, 2020

!wa delete-portal has existed for a long time. For private chats, just leaving the portal is enough.

@tulir tulir closed this as completed Jun 30, 2020
@christianlupus
Copy link
Author

@tulir I am sorry I do not get the point here. How does leaving the portal solve my issue? I want to have the whole history, I do not want to abandon a chat at all. I am a bit confused about what is your idea/suggestion.

@Zombie-Feynman
Copy link

@christianlupus !wa delete-portal does not delete or remove you from the WhatsApp room, it only drops the bridged portal. If you issue !wa delete-portal in the incorrectly-synced room and then send sync --create-all to the bridge bot, the portal will be recreated from scratch. This is only affects the Matrix side of things; it is completely invisible to anyone else in the actual WhatsApp room.

@christianlupus
Copy link
Author

@Zombie-Feynman I understand that the whatsapp users will be unaware of such an action.

I am more concerned about the following: Assume I have the matrix server be synced with whatsapp for quite some time. So I have the history in matrix from the point im time that the sync started (roughly). When I delete the portal, the room persists in matrix but no sync between the portal and the whatsapp chats are carries out anymore.
Now, I reestablish the connection by sync --create-all. Here comes the critical part. This command will create a portal and sync a certain set of the past messaged with the corresponding room.

  1. Is the very same matrix room used as portal or another one created?
  2. If the old one is used, how are the old messages handled? Are they removed?

If a new room is created each time this has to be done, I end up with a whole lot of rooms laying around. This might get a bit messy if it happens too often. Especially if I can do this only by chance (just to see if messages got dropped).

If the old room gets overwritten and the old messages get removed, the history I built up during the last months are no longer reachable in matrix.

@Zombie-Feynman
Copy link

@christianlupus The room and old messages get removed by !wa delete-portal. (I'm not sure if they invisibly linger on the server; if so, you need to manually garbage-collect them -- although this may be automated in the future.) The next time you sync, the room is recreated and old messages are reimported. If your history is truncated, increase initial_history_fill_count and sync_max_chat_age in config.yaml.

I had to perform this exact procedure because I forgot to check these values on install and didn't get enough old messages. Also, a room had synced before the contact list, so the user names weren't showing. Both are fixed by deleting the portal and syncing.

@NilsIrl
Copy link

NilsIrl commented Jul 28, 2023

Is there a way to guarantee everything will be synced? days_limit is already set to null (which I'm guessing means there is no limit) but it didn't sync everything. I wouln't want to re-create the bridge as it's a very long process. Is there not a way to populate the already existing rooms or at least just load the messages that have been missed rather than re-start from the beginning and not be guaranteed that everything will be there?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants