Skip to content

Conversation

@nlujjawal
Copy link
Contributor

Issue #, if available:
#5681

Description of changes:
When the editor is destroyed the pending callback(due to some async network request) created with editor.getSession.setMode causes an error which is avoided by aborting the callback in case if editor is destroyed.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Pull Request Checklist:

No backwards incompatible changes were made to Ace's public interface which is defined through the main typings file (ace.d.ts) and its references:
https://github.com/ajaxorg/ace/blob/master/ace.d.ts
https://github.com/ajaxorg/ace/blob/master/ace-modes.d.ts
https://github.com/ajaxorg/ace/blob/master/ace-extensions.d.ts

@codecov
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.06%. Comparing base (5acea6d) to head (e69d0e9).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5727   +/-   ##
=======================================
  Coverage   87.05%   87.06%           
=======================================
  Files         598      598           
  Lines       43703    43713   +10     
  Branches     7163     7164    +1     
=======================================
+ Hits        38047    38057   +10     
  Misses       5656     5656           
Flag Coverage Δ
unittests 87.06% <100.00%> (+<0.01%) ⬆️

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.

@InspiredGuy InspiredGuy requested a review from nightwing January 27, 2025 16:22
var originalOnChangeMode = session.$onChangeMode;

// Create spy
session.$onChangeMode = function(...arguments) {
Copy link
Member

@nightwing nightwing Jan 27, 2025

Choose a reason for hiding this comment

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

Why do we need the spy here? we already could see the call by effects it produces

@nightwing nightwing merged commit 62b973e into master Jan 28, 2025
3 checks passed
@nightwing nightwing deleted the fix_setmode_error_v2 branch January 28, 2025 11:26
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