Refactor: clean up code smells from PR #151 (catch-expired-session)#156
Draft
Refactor: clean up code smells from PR #151 (catch-expired-session)#156
Conversation
Co-authored-by: frwg <44997160+frwg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Review code for potential improvements and cleanups
Refactor: clean up code smells from PR #151 (catch-expired-session)
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Code quality issues introduced in PR #151 across
dataManager.element.jsandmapbender.element.digitizer.js: duplicated fail-listener construction, an opaque IIFE-curried arrow, minor formatting/spacing inconsistencies, and a misleading comment.Changes
Extract
_createFailListener(retryCallback)— the identical 3-line ternary guardingMapbender.handleAjaxErrorvs_onAjaxErrorfallback was duplicated in_loadGrants,postJSON, and_getData; now lives in one place:Simplify
_loadGrants.then()callback —(mergeWith => allGrants => { ... })(this.options.schemes)replaced with a plain arrow function accessingthis.options.schemesdirectly; the IIFE added no value since the callback already capturesthis.Spacing/formatting —
onGrantsLoadStarted: function()→function ()in both files; missing space before(response)inupdateMultiplecall.Comments — orphaned
// setup() called in onGrantsLoadStartedexpanded to trace the full call path;// can be overridden by digitizergeneralised to// can be overridden by subclasses.Original prompt
Created from VS Code.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.