Barcode Gen: fix first-save failure and make save errors descriptive - #236
Merged
Conversation
Fixes #234 - Call init_folder() in barcode_main() instead of free_app(), so /ext/apps_data/barcodes exists before the first save attempt instead of being created only on app exit. Also ensure the folder exists in save_barcode() as a safety net. - Show a message for empty Name/Data/Type instead of silently returning. - Detect the "file already exists" case in New mode (open_new fails on existing files) and report it instead of the generic error. - Add next_view to the message view so save errors return to the create view (keeping the entered data) instead of the main menu. - Support multiline messages in the message view. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Review follow-ups on top of the #234 fixes: - Fail the save with a specific message when an edit-mode rename would overwrite another barcode or the rename itself fails; sync the model path after a successful rename so a later failure leaves no stale path. - Check all flipper_format write results; a partially written file is no longer reported as "File Saved!". - Report a mkdir failure as "Cannot access the SD card" and log real init_folder failures as errors instead of "already exists". - Unify the New/Edit duplicate-name checks into one mode-independent clobber guard; collapse the three status flags into one error_message sentinel; only allocate the FlipperFormat when the save can proceed. - Move the show-message helper into the message view (message_view_show) and reuse it from edit_barcode_item; reuse init_folder in save_barcode. - Give next_view a safe default, dismiss only on short presses, and keep delete/save failures in the edit view so entered data survives. - Add CHANGELOG.md backfilled from repo and upstream release history; bump fap_version to 1.5. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Repository owner
locked as resolved and limited conversation to collaborators
Jul 25, 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #234
Problem
Creating a barcode (e.g. CODE-128) on a fresh install always failed with a generic "A saving error has occurred":
/ext/apps_data/barcodesfolder was only created byinit_folder()infree_app()- i.e. on app exit, never at startup - so the very first save had no folder to write into.save_barcode()collapsed every failure (missing folder, duplicate file name, missing SD card, empty fields) into one generic message, and empty name/data returned silently with no feedback at all.Changes
Folder creation (issue 1)
init_folder()now runs at startup inbarcode_main()and returns whether the folder is usable;save_barcode()calls it again before each save as a safety net (covers mid-session SD removal)Descriptive errors (issue 2)
flipper_format_write_*results are checked - a partially written file (e.g. SD card removed mid-save) is reported instead of "File Saved!"next_viewfield (with a safe default) and multiline rendering viaelements_multiline_text_alignedmessage_view_show()helper replaces three hand-rolled copies of the show-message sequenceHousekeeping
CHANGELOG.mdadded, backfilled for 1.1-1.4 from repo history and upstream releases;fap_versionbumped to 1.5message_view_free_model()declarationTesting
ufbt formatapplied🤖 Generated with Claude Code