Fix re-recording after export losing data (missing NEW:MISSION)#47
Fix re-recording after export losing data (missing NEW:MISSION)#47
Conversation
Summary of ChangesHello @fank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug that prevented successful re-recording of mission data after an export within the same running mission. Previously, the system failed to re-initialize the extension with a new mission session, leading to data loss. The changes introduce a mechanism to explicitly re-register the mission with the extension, update state management, and refine error logging to accurately reflect extension warnings versus critical failures, thereby improving the reliability and robustness of the recording system. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request effectively addresses a bug where re-recording after an export would fail due to a missing :NEW:MISSION: command. The changes are well-structured, involving invalidating the database state on export, detecting this state on re-record, and introducing a new function to re-register the mission. The improved error handling in fnc_sendData.sqf is also a good addition. I have one suggestion to improve the robustness of the new waiting logic in fnc_startRecording.sqf by adding a timeout.
Add a 30-second timeout with error logging and player notification when waiting for the extension to confirm the new mission. Prevents recording from silently stalling if the extension fails to respond.
|
Testing plan done.
|

Summary
"no mission to end: mission was never started"— the extension never received a:NEW:MISSION:command for the new recording sessiondbValid = falseafter export sostartRecordingknows to re-register the mission with the extension before starting the capture loopcallExtensionsetserrorCode=301(performance warning, not a failure)Root Cause
When an admin clicks "Start/Resume Recording" after a previous recording was exported (within the same running mission), the
OCAP_recordCBA event callsstartRecording→captureLoopdirectly. This bypassesinitDB, so:NEW:MISSION:is never sent to the extension. The extension has no active mission session, and all recorded data is lost when:SAVE:MISSION:is called.Changes
addons/recorder/fnc_exportData.sqfdbValid = falseafter saveaddons/database/fnc_initDB.sqf:MISSION:OK:handler against duplicate setup withinitialSetupDoneaddons/database/fnc_newMission.sqf:NEW:MISSION:using cached world/mission contextaddons/database/XEH_prep.sqfPREP(newMission)addons/recorder/fnc_startRecording.sqfdbValidbefore capture loop; if false, callnewMissionand wait for confirmationaddons/extension/fnc_sendData.sqferrorCode(warning) from extensionreturnCode(error)Test plan
Mission recording savedandMission uploadedNew mission logged(re-registration)Mission recording saved— no"no mission to end"error