Skip to content

fix: install the newest uploaded C-Gate zip - #149

Merged
cursor[bot] merged 1 commit into
masterfrom
dougrathbone/pick-newest-cgate-zip-b813
Oct 4, 2026
Merged

cursor[bot] merged 1 commit into
masterfrom
dougrathbone/pick-newest-cgate-zip-b813

Conversation

@dougrathbone

Copy link
Copy Markdown
Owner

Summary

Upload mode installs the newest C-Gate zip in the share folder. The previous lookup followed directory order, so a second zip dropped in for an upgrade could be ignored, and the installed file could change between boots.

Changes

  • Select the newest zip by modification time, and the later name when two files share a timestamp
  • Use that same file for the upload-mode upgrade check
  • Warn when more than one zip is present
  • Note the rule in the add-on docs

Test plan

  • npm test passes locally with no failures (3215 tests)
  • New code has unit test coverage
  • Existing tests were not broken or removed without justification
  • npm run lint passes
  • npm run typecheck passes

Checklist

  • Version bumped in package.json and homeassistant-addon/config.yaml (not releasing in this PR)
  • CHANGELOG.md updated (not releasing in this PR)
  • No sensitive data or credentials included
Open in Web Open in Cursor 

Upload mode claimed to follow the newest zip in the share folder, but the
lookup was find piped to head, which follows directory order. A second zip
dropped in for an upgrade could be ignored, and the one that was installed
could change between boots. The newest file is now the one that is installed,
with the later name winning when two files share a timestamp.

Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
@dougrathbone
dougrathbone marked this pull request as ready for review October 4, 2026 06:22
@cursor
cursor Bot merged commit e987834 into master Oct 4, 2026
25 checks passed
@cursor cursor Bot mentioned this pull request Oct 4, 2026
8 tasks done
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