fix: patch module based on reports from iniBuilds A350 launch#15
Merged
Conversation
Contributor
There was a problem hiding this comment.
I'm not a huge fan of unwrap_or_default in all these cases, could we instead just have graceful failure without a panic using Result? If all these values default to zero in failure cases, surely that makes it harder for the user application to tell what is invalid data and what is actually just (0, 0) coordinates? same goes for the other unwrap_or_default I didn't highlight
Contributor
Author
|
AFAIK this approach was taken in order not to break iniBuilds current implementation, which we assume is not ready to handle a change in behavior like that. Let's discuss it! |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request includes several changes across different files to improve error handling, add new enum variants, and enhance initialization logic. The most important changes are grouped by theme below.
Error Handling Improvements:
src/database/src/database.rs: Changed the handling ofValueRef::Blobto returnNoneinstead of panicking.src/database/src/output/airspace.rs: Updatedimpl Pathto useunwrap_or_defaultfor coordinates and handle invalid path types gracefully. [1] [2]src/database/src/output/fix.rs: Modifiedimpl Fixto returnFixType::Noneinstead of panicking for unexpected table values.src/database/src/output/procedure_leg.rs: Updatedimpl From<sql_structs::Procedures> for ProcedureLegto useunwrap_or_defaultand provide default values for missing data. [1] [2] [3]Enum Enhancements:
src/database/src/enums.rs: Added new variantsEithertoTurnDirectionandPavedtoRunwaySurface. [1] [2]src/database/src/output/airspace.rs: AddedUnknownvariant toPathType.Initialization and Update Logic:
src/wasm/src/dispatcher.rs: Introducedfirst_updateflag inDispatcherto handle initialization on the first update and adjusteddelta_timeinitialization. [1] [2] [3]Utility Function Improvements:
src/wasm/src/util.rs: Enhanced file handling functions to check for empty file names more safely. [1] [2]SIMDEV-350