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

enhancement: add events for conflicts #755

Open
crwood opened this issue Jun 14, 2024 · 1 comment
Open

enhancement: add events for conflicts #755

crwood opened this issue Jun 14, 2024 · 1 comment
Labels
enhancement New feature or request User Story Describes an experience a user can have with the software

Comments

@crwood
Copy link
Member

crwood commented Jun 14, 2024

#752 adds support for resolving conflicts via the web API and CLI, however, detecting that a conflict has occurred in the first place requires an amount of manual intervention that may be undesirable to developers and/or end users. Presently (AFAICT), detecting that a conflict has occurred requires either a) periodically checking/polling the /v1/magic-folder/<folder-name>/conflicts HTTP endpoint (which, at higher frequencies, can be wasteful on computing resources) or b) stumbling upon (and/or manually searching for) .conflict-<participant> tagged file extensions (which takes users away from other things and is thus wasteful on brain cycles).

Given that conflicts are typically both exceptional (i.e., somewhat rare) and important to end users (since they challenge local assumptions about the "true" or current working contents of a file), it would arguably be preferable if "conflicted" states were be detectable immediately (i.e., instead of on a timer) and easily (i.e., instead of via manual intervention/accident) so that users can be informed of such states as closely as possible to the action that caused them and be prompted to take necessary action (e.g., to resolve).

Or, in user story form:

"As a user who belongs to a folder in which multiple participants might modify a file, I want to be notified immediately if any modifications conflict with those of another so that I can take appropriate action (e.g., to resolve the conflict) as early as possible to prevent future confusion."

"As a user who belongs to a folder in which multiple participants might modify a file, I want to be notified automatically if any modifications conflict with those of another so that I can focus on my work and not spend time manually checking for conflicts."

"As a developer who wants to make Magic-Folder friendlier to humans, I want a simple streaming API that informs me of any/all events that might impact the integrity of user-data or require user intervention so that such things can be reported to users as soon as possible."

"As a developer who wants to make Magic-Folder friendlier to computers, I want a simple streaming API that informs me of any/all events that might impact the integrity of user-data or require user intervention so that I don't have to periodically poll multiple multiple endpoints or track state that is already tracked elsewhere."

@crwood
Copy link
Member Author

crwood commented Jun 14, 2024

In order to resolve the above, the existing "events" API could perhaps be expanded to emit new message "kinds" describing relevant conflict-related events -- perhaps something along the lines of:

{
  "kind": "conflict-detected",
  "folder": "Cat Pics",
  "timestamp": 1718386958.4481108,
  "relpath": "Classics/Garfield.jpg",
  "participants": ["Alice", "Bob"]
}

(For signaling that a conflict was detected)

...and:

{
  "kind": "conflict-resolved",
  "folder": "Cat Pics",
  "timestamp": 1718386975.57682,
  "relpath": "Post-Modern/Cat'thulu.png",
  "participants": ["Alice", "Bob"],
  "resolution": "Bob"
}

(For signaling that a conflict was successfully resolved)

These are just (non-exhaustive) examples; there may be better way(s) to express the above conditions -- and/or other revelant events to cover.

@meejah meejah changed the title Conflict-related events are missing from "events" API enhancement: add events for conflicts Jun 15, 2024
@meejah meejah added enhancement New feature or request User Story Describes an experience a user can have with the software labels Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request User Story Describes an experience a user can have with the software
Projects
None yet
Development

No branches or pull requests

2 participants