Skip to content

clear-pr-merge-commit-message fails often #6611

Closed

Description

@fregante

Description

This commit was sent (notice non-empty commit body)

b3e7358

How to replicate the issue + URL

  1. Open PR with a bunch of files sandbox#55
  2. Click "Merge" to open the box
  3. Notice that the box has been cleared
  4. Submit a new comment
  5. Notice box is closed when the comment is submitted
  6. Reopen box
  7. ❌ The commit message has returned and is empty

Extension version

23.4.15

Browser(s) used

Safari

Activity

  1. changed the title [-]`clear-pr-commit-message` occasionally fails[/-] [+]`clear-pr-merge-commit-message` occasionally fails[/+] on May 4, 2023
  2. raiyni commented on Dec 23, 2023

    @raiyni

    Not sure if this is the correct issue but this has been happening for a few months now where the extended description box for Squash and merge is filled with all of the commit message garbage.

    image

  3. fregante commented on Dec 23, 2023

    @fregante
    MemberAuthor

    My guess is that GitHub fills up the field a second time, but Refined GitHub does not catch that because it's the same field.

    Maybe GitHub fires some event we can listen to, or we have to go back to the "open merge box" event via delegate

  4. changed the title [-]`clear-pr-merge-commit-message` occasionally fails[/-] [+]`clear-pr-merge-commit-message` fails often[/+] on Oct 22, 2024
  5. fregante commented on Oct 29, 2024

    @fregante
    MemberAuthor

    I think the fix is simple:

    • use delegate('textarea selector', 'change', clear) instead of observe('textarea selector', clear)

    I saw that they always fire the event when it's opened:

    on('details:toggled', '.js-merge-pr', function (event) {
      const container = event.currentTarget
      const msgTextArea = container.querySelector('.js-merge-message')
      if (msgTextArea) {
        // Trigger size-to-fit for the merge message textarea
        fire(msgTextArea, 'change')
      }
    })
  6. added
    small
    Please! ♥︎
    on Oct 29, 2024
  7. fregante commented on Nov 1, 2024

    @fregante
    MemberAuthor

    Well well well.

    This was an intentional change 🥲

    I think that rather than unloading the feature, it should just check whether the field "is dirty", like GitHub does. I think this can be checked via class for now.

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

    Please! ♥︎acceptedbugoldest bug 🦖small

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions