Skip to content

fix(firmware_flasher): sort versions newest-first, ISO date format#607

Merged
nerdCopter merged 3 commits into
emuflight:masterfrom
nerdCopter:fix/firmware-flasher-version-sort
Jun 18, 2026
Merged

fix(firmware_flasher): sort versions newest-first, ISO date format#607
nerdCopter merged 3 commits into
emuflight:masterfrom
nerdCopter:fix/firmware-flasher-version-sort

Conversation

@nerdCopter

@nerdCopter nerdCopter commented Jun 18, 2026

Copy link
Copy Markdown
Member

AI Generated pull-request

Summary

  • Add published_at (ISO 8601) to each release descriptor as a stable sort key, independent of GitHub API response order
  • Sort firmware version dropdown by published_at descending when a board is selected — latest build always listed first; prior code relied on undocumented API response order which could produce oldest-first under cache or pagination edge cases
  • Change date display format from DD-MM-YYYY HH:MM to YYYY-MM-DD HH:MM; formattedDate is computed fresh from published_at on every release data load (1-hour cache TTL), so all displayed dates update automatically — FirmwareCache is unaffected (keyed on release.file)

Test plan

  • Build passes
  • Firmware Flasher: select each build type (Release, RC, Pre-Release Master); confirm version dropdown lists newest build at top
  • Confirm date column shows YYYY-MM-DD HH:MM format for all build types
  • Hardware verified: n/a (UI/display change only)

Summary by CodeRabbit

  • Bug Fixes
    • Firmware version list now displays newest releases first for better navigation
    • Standardized date formatting for firmware versions to YYYY-MM-DD HH:MM format

- Add published_at (ISO 8601) to each release descriptor as a stable
  sort key independent of GitHub API response order
- Sort firmware version dropdown by published_at descending when a board
  is selected, ensuring the latest build is always listed first; prior
  code relied on undocumented API response order which could produce
  oldest-first under cache or pagination edge cases
- Change date display from DD-MM-YYYY HH:MM to YYYY-MM-DD HH:MM;
  formattedDate is computed fresh from published_at on every release
  data load (1-hour cache TTL) so all displayed dates update
  automatically — FirmwareCache is unaffected (keyed on release.file)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 652a0d75-616f-40db-92bb-d13c50d9fc2f

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
📝 Walkthrough

Walkthrough

In firmware_flasher.js, the formattedDate string in buildBoardOptions is changed to a zero-padded YYYY-MM-DD HH:MM format using substring slicing. The board selection change handler now sorts a copy of TABS.firmware_flasher.releases[target] by published_at descending before rendering firmware version <option> elements.

Changes

Firmware Flasher Version Descriptor and Sort

Layer / File(s) Summary
Date format and descending sort for firmware options
src/js/tabs/firmware_flasher.js
formattedDate is reformatted to zero-padded YYYY-MM-DD HH:MM via substring slicing in the descriptor builder. The board-change handler now sorts a shallow copy of the releases array by published_at descending before appending <option> elements.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Possibly related PRs

  • emuflight/EmuConfigurator#573: Modifies the same board-change firmware version dropdown construction logic, including how version descriptors are built and firmware options are selected on target changes.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: sorting firmware versions newest-first and changing to ISO date format (YYYY-MM-DD HH:MM), which directly align with the primary objectives of the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/js/tabs/firmware_flasher.js`:
- Around line 184-185: The formattedDate variable is constructed using local
timezone Date methods (getMonth, getDate, getHours, getMinutes) which causes
different users in different timezones to see different timestamps for the same
firmware release. To ensure consistent date display across all users, replace
all the local timezone getter methods with their UTC equivalents: getUTCMonth,
getUTCDate, getUTCHours, and getUTCMinutes in the date formatting logic for the
formattedDate construction.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4d11bd53-8a94-474e-a8c2-f272ab7c01e6

📥 Commits

Reviewing files that changed from the base of the PR and between 8d56a80 and 75c46d6.

📒 Files selected for processing (1)
  • src/js/tabs/firmware_flasher.js
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: build (macos-26, macos-arm64)
  • GitHub Check: build (windows-2025, windows-x64, x64)
  • GitHub Check: build (macos-26-intel, macos-x86_64)
  • GitHub Check: build (windows-2025, windows-ia32, ia32)
  • GitHub Check: build (ubuntu-24.04, linux-x64)
🔇 Additional comments (2)
src/js/tabs/firmware_flasher.js (2)

187-198: LGTM!


339-341: LGTM!

Comment thread src/js/tabs/firmware_flasher.js Outdated
Published_at from GitHub API is UTC; local-timezone getters (getMonth,
getDate, getHours, getMinutes) caused users in different timezones to
see different timestamps for the same release. Swap all to UTC equivalents.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nerdCopter

Copy link
Copy Markdown
Member Author

AI Generated comment

Code changes in this PR are complete and working as expected. Two commits address the original issue:

  1. Firmware version dropdown now sorts newest-first via explicit published_at descending sort — no longer reliant on undocumented API response order.
  2. Date display changed to YYYY-MM-DD HH:MM using UTC getters for consistent cross-timezone display (addressing the CodeRabbit finding).

The Windows CI failure (@bitdisaster/exe-icon-extractor MSVC C2664) is a pre-existing native module issue unrelated to these changes — it also fails on the Dependabot electron bump PR #606 and would fail on master today. A separate fix is being tracked.

@nerdCopter nerdCopter merged commit 8b20614 into emuflight:master Jun 18, 2026
8 checks passed
@nerdCopter nerdCopter deleted the fix/firmware-flasher-version-sort branch June 18, 2026 14:19
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