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

JSON parsing: mine flag is wrong #7

Open
Conaclos opened this issue Nov 13, 2016 · 0 comments
Open

JSON parsing: mine flag is wrong #7

Conaclos opened this issue Nov 13, 2016 · 0 comments
Labels

Comments

@Conaclos
Copy link
Member

Conaclos commented Nov 13, 2016

Severity: Low
Fix causality; This issue should be fixed after #6

Background

The flag mine in a given block is used to know whether the current participant has authored the block.

This is useful since only the author of a block is authorized to prepend and append it.

Problem

This information is stored in the JSON representation of a block. It is used by other participants to recover the document.

This flag is potentially wrong since the participant is not necessarily the same. As a fix, this property is not used when the block is recovered. Instead the flag is always sets to false.

However this quick fix doesn't enable to a participant that authored a block in a previous session to extend it in the new session.

Possible fix

Replace the flag by a query function that tests if the block is authored by the current participant or not. This is possible by retrieving the participant identifier from the block's id and comparing this with the current participant's identifier.

The function isMine is already wrote in idfactory.ts.
The function could be passed during each block instantiation. To simplify this passing, we could use a factory method.

@Conaclos Conaclos added the bug label Nov 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant