Skip to content

highlight-deleted-and-added-files-in-diffs broken on single commits #6678

Closed

Description

@fregante

Description

refined-github.js:8317 Uncaught TypeError: Cannot read properties of undefined (reading 'cloneNode')
    at highlightFilename (refined-github.js:8317:27)
    at signal.signal (refined-github.js:8343:5)
    at refined-github.js:20154:3

Also welcome changes:

  • rename to new-or-deleted-file
  • use API instead of relying on the UI

My guess is that the feature was never intended to run on commits, but just PR commits. I'm also open to just disabling the feature on commits.

How to replicate the issue + URL

  1. refined-github/sandbox@1ed862e

Extension version

23.5.10

Browser(s) used

Chrome

Activity

  1. yakov116 commented on May 21, 2023

    @yakov116
    Member

    Using the api would be huge on big prs. Would also be multiple calls sine we done have all the commits on the page. Plus a pr can have more than 100 files if you wanted to load on pr files tab.

    Would require an uncashed call sone the files status could have changed by the tile you loaded the files tab again.

  2. fregante commented on May 21, 2023

    @fregante
    MemberAuthor

    I think you're confusing this with some other feature, we don't rely on commits.

    Depending on what's available on the v4 API, this might be as easy as "query current PR, get list of files, check if they're new or deleted", in a single query.

    If this isn't as easy as I described I agree it's best to not use the API though.

    Would require an uncached call

    That's what happens with the current view we're triggering anyway. The only advantage is that it now comes preloaded when/if the user actually opens the dropdown… but we still have to wait for it anyway, every time.

  3. yakov116 commented on May 21, 2023

    @yakov116
    Member

    Sorry I ment to say files not commits.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions