Skip to content

fix(windows): wipe _internal before upgrade to prevent stale dist-info version - #67

Merged
elkaix merged 2 commits into
mainfrom
fix/windows-stale-dist-info-upgrade
Jun 3, 2026
Merged

fix(windows): wipe _internal before upgrade to prevent stale dist-info version#67
elkaix merged 2 commits into
mainfrom
fix/windows-stale-dist-info-upgrade

Conversation

@elkaix

@elkaix elkaix commented Jun 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Inno Setup's ignoreversion recursesubdirs adds/overwrites files but never removes obsolete directories, so in-place upgrades left both pythinker_code-0.28.0.dist-info and pythinker_code-0.31.0.dist-info under _internal
  • importlib.metadata.version() returns the first path-finder match; alphabetical order puts 0.28.0 before 0.31.0, so the running 0.31.0 binary reported its version as 0.28.0
  • This caused the UI to display a stale version number and re-trigger the update prompt on every restart after a successful in-place upgrade
  • Uninstall + reinstall worked cleanly because the uninstaller wiped {app} entirely

Fix: Add [InstallDelete] to installer.iss to delete {app}\_internal before [Files] runs. _internal is 100% PyInstaller app payload — no user data lives there. Also adds a regression assertion to test_release_update_pipeline.py so this section can't be silently dropped.

Test plan

  • Existing test_release_update_pipeline.py suite passes (7/7) — includes new assertion that [InstallDelete] targets {app}\_internal
  • make check-pythinker-code passes (ruff + pyright clean)
  • Manual: install 0.31.0 over an existing install, verify version number shown is 0.31.0 and no update prompt fires on restart

elkaix added 2 commits June 2, 2026 22:13
…o version

Inno Setup's ignoreversion recursesubdirs adds files but never removes
obsolete ones, so in-place upgrades left both pythinker_code-0.28.0.dist-info
and pythinker_code-0.31.0.dist-info under _internal. importlib.metadata picks
the first path-finder match, which is the alphabetically-lower (older) version,
causing the UI to show the old version number and re-trigger the update prompt
after every successful upgrade. Uninstall+reinstall worked cleanly because
the uninstaller wiped {app} entirely.

Add [InstallDelete] to remove {app}\_internal before [Files] runs so each
upgrade starts from a clean directory. _internal is 100% PyInstaller app
payload; no user data lives there. Add a regression assertion to prevent
this section from being silently dropped.
@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (2)
  • WIP
  • DO NOT MERGE

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 86ae44ec-c979-4542-aebb-1603817bede9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-stale-dist-info-upgrade

Comment @coderabbitai help to get the list of available commands and usage tips.

@elkaix
elkaix merged commit fd80fb1 into main Jun 3, 2026
20 checks passed
@elkaix
elkaix deleted the fix/windows-stale-dist-info-upgrade branch June 3, 2026 02:33
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.

1 participant