Skip to content

no-useless-split-diff-view is broken on GitHub Enterprise #4483

Closed

Description

@fregante

here's how a recent diff looks with this feature enabled:

chrome_2021-06-17T090052

What do you think changed in this commit? Well it looks like that line was added - but it wasn't. The normal split diff looks like this:

chrome_2021-06-17T090115

You can see there's a subtle difference between the commits which is actually very important (there was a bug!)

Originally posted by @danielsamuels in #4399 (comment)

Strange, can't replicate.

Diff that's correctly unified: f60cb71

Reportedly problematic diff: 26e778f

Originally posted by @fregante in #4399 (comment)

This is on a GitHub Enterprise instance running 2.22.10, perhaps it's an incompatibility with that version?

Originally posted by @danielsamuels in #4399 (comment)

I think I know what's happening. It checks the left column first, it doesn't find the expected element ([data-split-side="${side}"]:is(.blob-code-addition, .blob-code-deletion)) and therefore it assumes it's empty.

Originally posted by @fregante in #4399 (comment)

Activity

  1. added
    enterprise
    on Jun 17, 2021
  2. fregante commented on Jun 17, 2021

    @fregante
    MemberAuthor

    The side detection code needs to be rethought to avoid future issues with this. With the current code, if GitHub changes the selector, this bug will happen again.

    For example, it should check whether the selector exists in at least one side. Alternative solutions welcome.

  3. simbo commented on Jun 18, 2021

    @simbo

    and disabling this feature seems to have no effect... 🤷‍♂️

  4. changed the title [-]`hide-empty-split-diff-side` is broken on GitHub Enterprise[/-] [+]`no-useless-split-diff-view` is broken on GitHub Enterprise[/+] on Jun 18, 2021
  5. fregante commented on Jun 18, 2021

    @fregante
    MemberAuthor

    Sorry about that, the feature was named no-useless-split-diff-view, not hide-empty-split-diff-side as its PR title suggested.

    I disabled it globally.

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

    acceptedbugenterprise

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions