mozillabrasil / sumo_live_helper

Helper Add-on for SUMO forum contributors
https://addons.mozilla.org/firefox/addon/sumo-live-helper-/
Mozilla Public License 2.0
7 stars 8 forks source link

Reappearing questions are marked as unread #153

Closed WesleyBranton closed 3 years ago

WesleyBranton commented 4 years ago

Description

Due to the API limitations, the add-on will only list up to 20 questions from each category. If the category has more than 20 questions, the oldest questions will not appear on the list. As new questions appear, the older questions fall off the list. As questions get replies and disappear from the list, old questions that fell outside of the top 20 reappear on the list.

Questions that reappear on the list are marked as unread, regardless of whether or not the user has previously read them. This is because that data is stored via the Storage API and the cleaner function will remove any saved questions that don't appear on the list. It does not do I time check.

Steps to Reproduce

  1. Subscribe to a category with more than 20 questions.
  2. Mark the bottom question as read.
  3. Wait for a new question to appear in the category, which will bump the bottom question off the list.
  4. Reply to a thread on the list.

Expected behavior: The old question should get added to the list again, either as read or unread (depending on the status prior to removal).

Actual behavior: The old question is always marked as unread.

Additional Information

This issue also impacts questions that are removed from the list if a user starts typing in the thread (triggering the "taken" flag), but then abandons the thread without posting.

The cleaner function for the question list stored in the Storage API needs to have an additional check to only delete questions that are older than 24 hours, since those questions cannot possibly reappear on the list.

An alternative to this would be issue #154.