Open mrchainman opened 4 years ago
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)
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.
@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.
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.
Haven't thought about that. I will look into it as soon as I have the time.
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?