Skip to content

Every feature using delegate and deduplicate is broken on history navigation #5871

Closed

Description

@fregante

Description

Here's what happens:

  1. We create the DOM elements and attach the delegated listeners
  2. The user navigates away
  3. We remove the listeners
  4. The user goes back
  5. init is not run again because it's "deduplicated"

At this point, the elements still exist, but they have no listeners.

How to replicate the issue

  1. From this issue
  2. Click the "Issues" tab
  3. Go back
  4. Click the collapsible-content-button

I'm fixing this feature specifically, but likely all of them are.

Related:

Extension version

main

Browser(s) used

Chrome

Activity

  1. changed the title [-]Every feature using `delegate` and `deduplicate: has-rgh` is broken on history navigation[/-] [+]Every feature using `delegate` and `deduplicate` is broken on history navigation[/+] on Jul 30, 2022
  2. fregante commented on Aug 5, 2022

    @fregante
    MemberAuthor

    #5873 took care of delegate-only features. Features with "change dom + delegate" in their init are still broken, they will need changes like:

    This is now a sub-issue of #5895, but just for features that use delegate:

  3. fregante commented on Aug 7, 2022

    @fregante
    Author
  4. fregante commented on Sep 20, 2022

    @fregante
    MemberAuthor

    Not many features left to close this issue ☺️

    ❯ rg -l deduplicate $(rg -l delegate source/features/*.tsx) | sort -R
    source/features/convert-release-to-draft.tsx
    source/features/comment-fields-keyboard-shortcuts.tsx
    source/features/pr-filters.tsx
    source/features/hide-low-quality-comments.tsx
    source/features/one-click-review-submission.tsx
    source/features/copy-file.tsx
    source/features/esc-to-cancel.tsx
    source/features/one-click-diff-options.tsx
    source/features/rgh-sponsor-button.tsx
    source/features/rgh-welcome-issue.tsx
    source/features/deep-reblame.tsx
    • convert-release-to-draft
    • comment-fields-keyboard-shortcuts
    • pr-filters
    • hide-low-quality-comments
    • one-click-review-submission
    • copy-file
    • esc-to-cancel
    • one-click-diff-options
    • rgh-sponsor-button
    • rgh-welcome-issue
    • deep-reblame
  5. self-assigned this
    on Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions