Skip to content

Adapt.on('popup:opened') listener leak in NarrativeView.openPopup #345

Closed

Description

@oliverfoster

Subject of the issue

Every call to openPopup() in NarrativeView.js registers a new anonymous Adapt.on('popup:opened', ...) listener that is never removed:

https://github.com/adaptlearning/adapt-contrib-narrative/blob/master/js/NarrativeView.js#L319-L322

Because it's bound with Adapt.on() directly (not this.listenTo), and a new closure is added on every popup open, listeners accumulate for the lifetime of the page. Each accumulated handler also fires for any popup opened anywhere in the course (not just this narrative's own), so currentItem.toggleVisited(true) runs for unrelated popups too.

Your environment

  • Adapt Framework v6 / adapt-contrib-narrative 7.13.1
  • Any browser
  • N/A (logic bug, not device-specific)

Steps to reproduce

  1. Add a narrative component with items that have a title or strapline set (so their popup can be opened).
  2. Open and close a narrative item's popup several times.
  3. Inspect Adapt._events['popup:opened'] in the console — its length grows by one on every open and is never reduced.

Expected behaviour

Only one popup:opened binding should exist per narrative view instance, cleaned up with the view, and it should only react to the popup that narrative instance itself opened.

Actual behaviour

Listeners accumulate indefinitely, and any popup opened elsewhere in the course incorrectly marks the narrative's current item as visited.

Activity

  1. self-assigned this
    on Jul 27, 2026
  2. moved this from New to Needs Reviewing in adapt_framework: The TODO Boardon Jul 27, 2026
  3. added theissue type on Jul 27, 2026
  4. added a commit that references this issue on Aug 19, 2026
    20f8bdb
  5. moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Boardon Aug 19, 2026
  6. added a commit that references this issue on Aug 19, 2026
    16d1fe1
  7. github-actions commented on Aug 19, 2026

    @github-actions

    🎉 This issue has been resolved in version 7.13.2 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions