Skip to content
Commit f861c5f0 authored by Martin Abente Lahaye's avatar Martin Abente Lahaye
Browse files

permission-store: Don't crash when deleting permissions

The permission store crashes when it attempts to remove
the last entry of an specific  table and id pair,  e.g.
"notifications", "notification", "a".

The crash occurs due to the assumption that there should
still be one entry left after the operation,  but is not
the case here.

Prevent this by writing an empty entry for this specific
table and id  pair, instead. So  that the specific  pair
is kept in the database.

I assume this is the right thing to do, due to:

1. There's a separate API for deleting table and ids pairs.
2. The removal-related code already assumes that there should
   be at least one entry left after this operation.
3. It's what "flatpak permissions-reset --all" does.

Closes #573
parent 89d21970
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment