Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent ScriptRunner Ctrl-S Save from Saving Old Buffers #1356

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

ryanmelt
Copy link
Member

ScriptRunner was attaching the keydown event to window rather than the current editor. This causes a new hook to be attached everytime a user leaves scriptrunner and came back. Old hooks remained bound to old editors, so a ctrl-s would cause multiple saves with a random last save being the winner and ending up being committed.

Fix is to attach to the editor, not window.

@ryanmelt ryanmelt requested a review from jmthomas June 24, 2024 00:25
Copy link

codecov bot commented Jun 24, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 73.70%. Comparing base (a3f4b9a) to head (9755ee1).

Files Patch % Lines
...os-cmd-tlm-api/app/controllers/model_controller.rb 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1356      +/-   ##
==========================================
- Coverage   75.19%   73.70%   -1.50%     
==========================================
  Files         600      600              
  Lines       44681    44680       -1     
  Branches      777      777              
==========================================
- Hits        33599    32932     -667     
- Misses      10995    11661     +666     
  Partials       87       87              
Flag Coverage Δ
python 83.65% <ø> (+<0.01%) ⬆️
ruby-api 48.57% <0.00%> (-0.02%) ⬇️
ruby-backend 76.98% <ø> (-3.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Copy link
Member

@jmthomas jmthomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is related to some of the "random" overwrite errors. Great find!

@ryanmelt ryanmelt merged commit e3c5a4e into main Jun 25, 2024
31 of 32 checks passed
@ryanmelt ryanmelt deleted the script_runner_ctrl_s_save_old_buffers branch June 25, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants