Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Persistent Storage #3

Open
mrchainman opened this issue Mar 11, 2020 · 5 comments
Open

Persistent Storage #3

mrchainman opened this issue Mar 11, 2020 · 5 comments

Comments

@mrchainman
Copy link
Owner

We could achieve persistent storage, by dumping the pushed notifications list to a json file and trying to load in on startup,
@berdosi What do you think about that?

@berdosi
Copy link
Collaborator

berdosi commented Mar 11, 2020

I thought about it, and I consider it as a nice-to-have:

The app re-sending the notifications looks somewhat sloppy, indeed.

However, this happens when someone restarts the app, without having marked their notifications as read. I would say that this is even useful during development, but doesn't normally happen on the everyday usage (as the app isn't supposed to be restarted that often)

@mrchainman
Copy link
Owner Author

The problem is that if the nextcloudserver is unavailable even for just a moment the app crashes, i have it running as a systemd service with autorestart and it restarts every other day, as my server is quite slow. It would be 5 lines of code to implement it, so not a big deal.

@mrchainman
Copy link
Owner Author

@berdosi I noticed that it does not only happen when restarting the app. Everytime a new notification is pulled, all the ones not marked as read are resend.

@berdosi
Copy link
Collaborator

berdosi commented Mar 16, 2020

Hm.
Perhaps m["ocs"]["data"][i]["notification_id"] is treated as an object, and its equality is tested by reference? If so, converting it explicitly to a string could solve the issue.
I'm not very experienced in Python, my argument may be invalid.

@mrchainman
Copy link
Owner Author

Haven't thought about that. I will look into it as soon as I have the time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants