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

Messenger : Read messages from many iteration of Smart contract #4

Open
gdaguin opened this issue Sep 29, 2023 · 1 comment · May be fixed by #5
Open

Messenger : Read messages from many iteration of Smart contract #4

gdaguin opened this issue Sep 29, 2023 · 1 comment · May be fixed by #5
Labels
feature New feature request

Comments

@gdaguin
Copy link
Contributor

gdaguin commented Sep 29, 2023

Is your feature request related to a problem?

No response

Describe the solution you'd like

Each time a discussion is modified (addition of members, change of admin, modification of group name, etc.), the discussion transaction chain evolves with updates to the smart contract.
This means that messages sent by users are received in the last address of the smart contract transaction chain.
So a smart contract at index 1 may have 4 messages as inputs, at index 2, 6 messages, etc....

Currently, only the inputs in the last address of the chain are read.

Describe the solution you'd like
The previous addresses must therefore be read to retrieve all the messages.

To avoid performance problems, use the limit property passed to the read method of the MessagesMixin mixin.
If the limit is not reached for the txContentMessagesAddresses list, then the inputs from the previous transaction are retrieved.

Additional context

No response

Epic

No response

@gdaguin gdaguin added the feature New feature request label Sep 29, 2023
@gdaguin
Copy link
Contributor Author

gdaguin commented Sep 29, 2023

Don't forget to test (in the wallet, messenger_repo => getMessages) when an user leaves a discussion => retrieve old messages

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

Successfully merging a pull request may close this issue.

1 participant