Conversation
Winds last_viewed back to the second-newest snapshot so the row shows as unviewed again and [diff] still opens on the latest change. Watches with fewer than two snapshots are skipped, there is no change to un-view.
|
Strange, this breaks |
|
re-running tests |
|
@pongoe the
res = client.get(url_for("watchlist.index"))
assert b"unviewed" not in res.dataThis PR adds the button Fix: check for the CSS class the row actually gets, which is what your new assert b'has-unread-changes' not in res.dataAlso, (The later re-run failed for a different reason: it couldn't download the Docker image artifact, so no tests ran.) |
|
So yeah, please find a way to fix that other test :-) |
…nviewed" The new "Mark unviewed" button puts the word "unviewed" on every watch list page, so these substring checks always failed or always passed.
…ewed # Conflicts: # changedetectionio/translations/messages.pot
|
Thanks for digging into the failure. You're dead right. I tried it both ways, the old check failed and the new one passed, so this is definitely the fix now. Swapped both tests over like you said. Thank God it's the weekend! |
Closes #4382
Adds a "Mark unviewed" button next to "Mark viewed" in the watch list bulk operations bar.
The use case is the one in the issue. You open a change, you cannot deal with it yet, and you want the watch to show as unviewed again.
The operation sets
last_viewedback to the timestamp of the second-newest snapshot, not to 0. As a result, the row is unviewed again and [diff] still opens on the latest change, not on the full history. Watches with fewer than two snapshots have no change to un-view, so the operation skips them. The toast shows the real count.The form POST and the socket.io path both go through
_handle_operations, so both work.tests/test_mark_unviewed.pyextract_messages/update_catalog)