cyclestreets / cyclescape

Cyclescape - cycle campaign group toolkit
https://www.cyclescape.org/
MIT License
33 stars 15 forks source link

E-mails should include a 'Last read' tracking pixel #917

Open mvl22 opened 4 years ago

mvl22 commented 4 years ago

Currently, the system remembers the last message that a user has read, and scrolls them to that.

A particularly heavy user of the system, who uses e-mail, has always found this doesn't work well, and we've now worked out why: the e-mails of course don't have that same memory. For them this is a major usability issue.

So we should include a pixel image which the e-mail would load, which does the same thing - it would contain a token to signal back to the server the user+message combination.

This would need to be a hash or have a user token, so that it can't be faked by other users.

nikolai-b commented 4 years ago

I'm not sure about this as it is possible that message 1, 2, 3 and 4 are posted but only email 4 read. Which message do we scroll to, 4 or 1 (as we don't think they've seen that). We could store a link to each message but that would require a bit of re-architecture. If you happy with just scrolling to message 4 even if they've not read 1,2 and 3 then I can do that pretty easily.

mvl22 commented 4 years ago

We simply need to work on the basis that:

If you happy with just scrolling to message 4 even if they've not read 1,2 and 3 then I can do that pretty easily.

The same applies on the website though - we have no guarantee that people have actually read messages 1,2,3 if they scroll to 4.

nikolai-b commented 4 years ago

Currently if a user opens a thread we store the time (no message IDs) that the thread was opened by that user in the thread_views table which has thread_id, user_id, viewed_at.

With email we could do something like:

new_thread_viewed_at = message.created_at
if(thread_view.viewed_at < new_thread_viewed_at)
  thread_view.update(viewed_at: new_thread_viewed_at)
end

so only update if the message in the email is newer than the existing thread view, and use the created at time of the message.

The webpage has all the different messages in a long list so although they might not scroll to the end they are all visible. With email it is easy to open the last email in a thread and not open the previous emails so although there is no guarantee they've read the previous messages on the webpage, with email we might actually know that they haven't read some previous messages yet we still are marking them as read.