Skip to content

Revert startup performance PRs #2930 and #2931 - #2933

Merged
bajrangCoder merged 2 commits into
mainfrom
revert-startup-perf
Sep 24, 2026
Merged

bajrangCoder merged 2 commits into
mainfrom
revert-startup-perf

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

Reverts #2931 and #2930, which were merged together. The startup work goes back into a single PR for review before anything lands on main.

  • Two standard revert commits, newest first. No history is rewritten.
  • The resulting tree is identical to 3e2e0ab4 (feat: review button in plugin page (#2925)), the commit before both PRs.

The consolidated startup PR is stacked on this branch and retargets to main once this merges.

🤖 Generated with Claude Code

bajrangCoder and others added 2 commits September 24, 2026 18:43
…mand registration (#2931)"

This reverts commit 60acb25.

The startup work is being consolidated into a single PR for review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This reverts commit 5a7cc93.

The startup work is being consolidated into a single PR for review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bajrangCoder
bajrangCoder added this pull request to the merge queue Sep 24, 2026
Merged via the queue into main with commit b7dbe3d Sep 24, 2026
9 checks passed
@greptile-apps

greptile-apps Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 2/5

The PR does not appear safe to merge until Owned plugins rendering, billing-gated startup, and offline Pro restoration are addressed.

Findings

  1. P1 Owned plugins list crashes ▶
  2. P1 Billing can block startup ▶
  3. P1 Confirmed Pro purchase not cached ▶
  4. P2 Sponsor cancellation goes unhandled ▶
  5. P2 Command bursts repeat keymap work ▶
  6. P2 Preview dependencies load at startup ▶
  7. P2 Sidebar chunks load sequentially ▶
  8. P2 Encoding lookup delays every launch ▶
  9. P2 Bundled themes slow module loading ▶

Summary

This PR reverts two startup-performance changes, restoring earlier loading, entitlement, command-keymap, and plugin-page behavior.

  • The revert introduces an Owned plugins scope error and makes workspace startup depend on unbounded billing callbacks.
  • It also drops persistence of Pro status discovered at startup and restores several avoidable startup costs.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Device ready] --> B[Encoding bridge request]
  B --> C[Storage and installer setup]
  C --> D[Await Play Billing]
  D --> E[Build and restore workspace]
  E --> F[Load plugins and check account]
  D -. stalled callback .-> G[Workspace remains unavailable]
Loading

Reviews (1) · Last reviewed commit: "Revert "perf: speed up app startup (#293..."

const disabledMap = settings.value.pluginsDisabled || {};
if (helpers.isIapAvailable()) {
iapPurchases = await helpers.promisify(iap.getPurchases);
const disabledMap = settings.value.pluginsDisabled || {};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Owned plugins list crashes When a signed-in user opens Owned plugins on a device where IAP is unavailable, an installed plugin reaches disabledMap[plugin.id]. The map is now declared inside the IAP-only block, so this throws a ReferenceError and stops the list from rendering.

Knowledge Base Used: Plugin lifecycle and extension management

Comment thread src/main.js

window.ANDROID_SDK_INT = androidSdkInt;
try {
await helpers.promisify(iap.startConnection).catch((e) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Billing can block startup If Play Billing is slow or never calls back, startup waits for its connection and purchase checks before calling loadApp(). Neither await has a timeout, and the ten-second warning only changes the message, so the editor is delayed or never opens.

Knowledge Base Used: Startup orchestration

Comment thread src/main.js
Comment on lines +216 to +219
if (isPro) {
config.HAS_PRO = true;
} else {
config.HAS_PRO = !isFreePackage;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Confirmed Pro purchase not cached When startup finds a Pro purchase on a free build, it sets HAS_PRO but no longer saves the result in localStorage.acode_pro. If that user next launches offline, startup skips the purchase lookup and starts without Pro, locking paid features and allowing ads.

Knowledge Base Used: Application bootstrap and runtime composition

value: true,
},
]).catch(() => null);
]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Sponsor cancellation goes unhandled Cancelling multiPrompt rejects its promise. Without the removed catch, that rejection escapes the click handler instead of reaching the intended early return, so an ordinary cancellation is logged as an unhandled rejection.

Comment thread src/cm/commandRegistry.js
}

invalidateKeymap();
rebuildKeymap();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Command bursts repeat keymap work Each external command registration now rebuilds the full keymap, and the subsequent refresh immediately reconfigures each affected editor pane. A plugin registering many commands repeats that work for every command instead of sharing one rebuild and dispatch, adding avoidable startup work.

Knowledge Base Used: Application bootstrap and runtime composition

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread src/lib/editorFile.js
import { openTabContextMenuOnRelease } from "handlers/tabContextMenu";
import tag from "html-tag-js";
import quickToolsAdapters from "lib/quickToolsAdapter";
import mimeTypes from "mime-types";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Preview dependencies load at startup editorFile is loaded during startup, so its static mime-types and run imports also pull in the MIME database and preview dependencies before either feature is used. This increases the initial bundle and the work needed to open the editor.

Knowledge Base Used: Startup orchestration

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread src/sidebarApps/index.js
Comment on lines +89 to 93
add(...(await import("./files")).default);
add(...(await import("./searchInFiles")).default);
add(...(await import("./extensions")).default);
add(...(await import("./notification")).default);
setSponsorSidebarAppVisibility(appSettings.value.showSponsorSidebarApp);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Sidebar chunks load sequentially Each sidebar import now starts only after the previous one finishes. These four independent chunks are loaded during workspace setup, so their load times add up instead of overlapping, delaying startup.

Knowledge Base Used: Startup orchestration

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread src/utils/encodings.js
}
}

export async function initEncodings() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Encoding lookup delays every launch Removing the cache makes initEncodings() request the encoding list through the native bridge every time. Because startup now awaits it before beginning independent storage and device setup, every launch pays for that round trip before other initialization can proceed.

Knowledge Base Used: Startup orchestration

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment thread src/cm/themes/index.js
};

if (validate && !validateThemeExtensions(key, theme.getExtension())) {
if (!validateThemeExtensions(key, theme.getExtension())) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Bundled themes slow module loading Bundled themes now use addTheme, which constructs a CodeMirror state to validate each theme as the module loads. Doing this for every bundled theme before the workspace starts adds synchronous startup work even when those themes are not selected.

Knowledge Base Used: Startup orchestration

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@bajrangCoder
bajrangCoder deleted the revert-startup-perf branch September 24, 2026 13:19

@rgmwash-byte rgmwash-byte left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants