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

[Task] Disambiguate message_id in IotaDocument #361

Closed
3 of 9 tasks
cycraig opened this issue Aug 18, 2021 · 0 comments · Fixed by #540
Closed
3 of 9 tasks

[Task] Disambiguate message_id in IotaDocument #361

cycraig opened this issue Aug 18, 2021 · 0 comments · Fixed by #540
Assignees
Labels
Enhancement New feature or improvement to an existing feature

Comments

@cycraig
Copy link
Contributor

cycraig commented Aug 18, 2021

Description

Add integration_message_id and diff_message_id to IotaDocument.

Motivation

The message_id stored in a resolved IotaDocument is typically the message_id of the last document published to the integration chain. When there are diff chain updates merged in during resolution, the message_id becomes MessageId::Null (all zeroes). This is somewhat correct in that a resolved document with merged diff changes does not have a message_id because it is not technically on the Tangle in that state. Unfortunately, it makes it difficult to apply new updates (to either the integration or diff chain) due to the lack of a message_id to set for previous_message_id.

This proposal is to keep the current behaviour to avoid a breaking change for now and add two new fields: integration_message_id, and diff_message_id. The integration_message_id is equivalent to the current message_id except it is not overwritten when applying diff updates, and diff_message_id is simply the message_id of the last merged DocumentDiff. These ids will need to be set during resolution and care needs to be taken to ensure the Account maintains them too, as it essentially adds more state to the IotaDocument that can become outdated or incorrect.

Edit: this should be part of the larger refactor of document metadata and resolution metadata.

To-do list

Create a task-specific to-do list . Please link PRs that match the To-do list item behind the item after it has been submitted.

  • Add integration_message_id and diff_message_id to IotaDocument or metadata
  • Add/update tests
  • Update examples?

Change checklist

  • The feature or fix is implemented in Rust and across all bindings whereas possible.
  • The feature or fix has sufficient testing coverage
  • All tests and examples build and run locally as expected
  • Every piece of code has been document according to the documentation guidelines.
  • If conceptual documentation (mdbook) and examples highlighting the feature exist, they are properly updated.
  • If the feature is not currently documented, a documentation task Issue has been opened to address this.
@cycraig cycraig added the Added A new feature that requires a minor release. Part of "Added" section in changelog label Aug 18, 2021
@cycraig cycraig self-assigned this Aug 18, 2021
@cycraig cycraig removed their assignment Sep 23, 2021
@cycraig cycraig self-assigned this Nov 8, 2021
@eike-hass eike-hass added Enhancement New feature or improvement to an existing feature and removed Added A new feature that requires a minor release. Part of "Added" section in changelog labels Dec 2, 2021
@cycraig cycraig mentioned this issue Dec 9, 2021
10 tasks
@cycraig cycraig linked a pull request Dec 9, 2021 that will close this issue
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants