Page MenuHomePhabricator

Optimisation: When all sections are collapsed, localStorage should be cleaned up
Closed, DuplicatePublic

Description

Steps to reproduce

  1. Login and visit https://en.m.wikipedia.org/wiki/Barack_Obama on the MinervaNeue mobile site on a small width device. You cannot set the width after visiting.
  2. Ensure all sections are closed.
  3. Tap a section to open it.
  4. View localStorage.expandedSections in DevTools. E.g., "{"Spain":{},"Barack Obama":{"Bibliography":1551912223488},"Al-Mu'tasim":{},"Theophilos (emperor)":{}}".
  5. Tap a section to close it.
  6. View localStorage.expandedSections in DevTools.

Expected results

  • No entry should exist for the default presentation

Actual results

  • Empty entries are persisted. For example: "{"Spain":{},"Barack Obama":{},"Al-Mu'tasim":{},"Theophilos (emperor)":{}}".

Environments observed

  • Browser version:
  • OS version: Chromium v71.0.3578.98
  • Device model: Ubuntu v18.10
  • Device language: English

Check any additional observations

Acceptance criteria

  • It should be impossible for a value {} to be stored inside
JSON.parse(localStorage.expandedSections)

Developer notes

Object.keys() can be used here when removing an entry from the expandSections object. When it's 0 make sure you use delete and remove it from the object.

Event Timeline

ovasileva triaged this task as Medium priority.Mar 7 2019, 2:41 PM
Jdlrobson renamed this task from [Bug] When all sections are collapsed, localStorage should be cleaned up to Optimisation: When all sections are collapsed, localStorage should be cleaned up.Mar 8 2019, 1:39 AM
Jdlrobson updated the task description. (Show Details)
Jdlrobson lowered the priority of this task from Medium to Low.Jul 31 2019, 6:49 PM