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

Source list doesn't update right away when you delete multiple sources #1113

Closed
sssoleileraaa opened this issue Jun 16, 2020 · 1 comment · Fixed by #1114
Closed

Source list doesn't update right away when you delete multiple sources #1113

sssoleileraaa opened this issue Jun 16, 2020 · 1 comment · Fixed by #1114
Labels
bug Something isn't working

Comments

@sssoleileraaa
Copy link
Contributor

STR

  1. run make dev
  2. run the client and log in
  3. delete both sources right away within one sync period

Expected

Next sync both source widgets in the source list are gone

Actual

Next sync the first source widget disappears. Next sync after that the second source widget disappears.

You also see the "Nothing to see just yet" and "Deleting..." message at the same time.

Why is this happening?

In the source list update method we delete items in the QListWidget that we are iterating through which changes the number of iterations we make in the deletion loop:

for i in range(self.count()):
list_item = self.item(i)
list_widget = self.itemWidget(list_item)
if list_widget and list_widget.source_uuid not in source_uuids:
if list_item.isSelected():
self.setCurrentItem(None)
try:
del self.source_widgets[list_widget.source_uuid]
except KeyError:
pass
self.takeItem(i)
deleted_uuids.append(list_widget.source_uuid)
list_widget.deleteLater()

@sssoleileraaa sssoleileraaa added the bug Something isn't working label Jun 16, 2020
@sssoleileraaa
Copy link
Contributor Author

Another STR that shows the problem with the current source-deletion logic from the server-side deletion perspective:

STR 2

  1. run make dev
  2. run the client and log in
  3. NUM_SOURCES=0 make dev

Expected

Next time the client can connect to the server during a sync, both source widgets in the source list are gone

Actual

Next sync the first source widget disappears. Next sync after that the second source widget disappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant