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

When deleting a local entity, remote version change causes endless loop of conflict resolution #5114

Open
guyarad opened this issue Jun 27, 2018 · 7 comments
Labels
bug A bug - let's fix this!

Comments

@guyarad
Copy link
Contributor

guyarad commented Jun 27, 2018

Repro steps:

  1. Delete a node (or other entities) locally.
  2. From browser/computer (possibly with another user) make a change to that entity, causing a version bump.
  3. Attempt to save your changed.

Actual behavior:

  • If you had other modifications, besides deletion, you will see endless loop of upload and then nodes requests to the server (and the UI will display loading).
  • otherwise, you will see an endless of loop of upload requests.

Expected behavior:

  • A conflict resolution screen is displayed
  • Local change, if selected, is saved
@guyarad
Copy link
Contributor Author

guyarad commented Jun 27, 2018

I have done a preliminary analysis of the issue. It seems like the client isn't asking the server for the deleted node as part of the node request, in order to detect the conflicts.

The reason it's not asking for is this line.
However, simply asking for deleted as well won't do the trick, because later when detecting conflicts here, it will fetch the entity from the coreGraph, but due to weird code here it will simply fetch the base entity, which will in turn resolve the conflicts easily without involving the user, and without even knowing it was deleted, so the end result is local changes are essentially discarded.

Seems like there needs to be a flow that's aware of locally deleted nodes and offers the resolve these conflicts properly.

@tyrasd
Copy link
Member

tyrasd commented Jun 27, 2018

Nice catch!

but due to weird code here

Yeah, that was a workaround for a bug in some versions of Chrome/Chromium on Linux. I believe it can be removed now since the underlying bug has been fixed in newer versions of Chrome by now (I assume?!).

@guyarad
Copy link
Contributor Author

guyarad commented Jun 27, 2018

@tyrasd I'm good like that :)

but it can't be really removed easily.
Because if removed, when attempting to get an entity from the coreGraph, it will throw if the entity is deleted locally.
That being said, it's probably a good thing because it will identify places which attempted getting an entity without checking if it's there first.

@guyarad
Copy link
Contributor Author

guyarad commented Jun 27, 2018

Also, in my opinion, hasEntity is a little broken for locally deleted entities. It will return false even thought the graph does have the entity, in a sense.

@tyrasd
Copy link
Member

tyrasd commented Jun 27, 2018

I agree that in order to fix the reported problem, there must be done more than just removing the odd workaround. Maybe it will be necessary to store a visible=false version for deleted objects (instead of just setting them to undefined in the graph) in order to fix the issue. 🤔

@bhousel bhousel added the bug A bug - let's fix this! label Jun 27, 2018
@bhousel
Copy link
Member

bhousel commented Jun 27, 2018

Yeah, that was a workaround for a bug in some versions of Chrome/Chromium on Linux. I believe it can be removed now since the underlying bug has been fixed in newer versions of Chrome by now (I assume?!).

yeah I agree - It's been a year since we needed to patch Chrome 58/59.. we can probably remove it.

Also, in my opinion, hasEntity is a little broken for locally deleted entities. It will return false even thought the graph does have the entity, in a sense.

This is the design of how it works. hasEntity is supposed to return undefined if the entity has been deleted.

That said, the save.js code can be improved - it already checks the modified objects, and it should check the deleted objects too.

@erkinsergey
Copy link

erkinsergey commented Apr 3, 2019

I also have this issue in version 2.12.2 when editing and deleting the same objects.
I also saw in source codes that deleted objects are not checked, only modified.
Please inform if something changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug - let's fix this!
Projects
None yet
Development

No branches or pull requests

4 participants