senekor / buenzlimarks

A simple web app for bookmark management
The Unlicense
0 stars 0 forks source link

Empty pages after deleting a bookmark #132

Closed Hase024 closed 10 months ago

Hase024 commented 1 year ago

After deleting a bookmark, all widgets on all pages disappear. After reload of the bokkmarks page, everything is ok. All bookmarks and widgets are back, just the deleted is gone.

senekor commented 1 year ago

I think this might be a difficult bug to fix. @Robrisi let's do this together some time.

senekor commented 1 year ago

Removed the requirement label, because it's a bug report.

senekor commented 10 months ago

This was fixed by #141.

The redux state pattern itself wasn't the fix, but it and the fix went hand-in-hand.

The problem was that widgets and bookmarks would rerender themselves reactively when they changed. Including when they were deleted. This meant a refetch of the data was triggered and sice that widget / bookmark didn't exist anymore, the request failed and the app crashed.

(Error handling is still pretty much non-existent.)

With the fix, widgets and bookmarks don't rerender themselves reactively anymore. The key of these components in the widget / bookmark list is now the entire object itself, as can be seen in this diff. This means the For component will render a new widget / bookmark top-down when anything changes. The For component then also handles deletions correctly.