Problem
After un-merging a dive (PR #129), the split-off dive retains remapped gasmixIndex values from the merge. For example, a Halcyon dive that was merged with a Shearwater CCR dive (which had gas mixes at indices 0-3) has its samples remapped to gasmixIndex = 4. After un-merging, the Shearwater gas mix records are removed but the Halcyon samples still reference index 4 — so the chart shows "Gas 5" instead of "Gas 1".
Expected
When un-merging, the split logic should re-index gasmixIndex on samples belonging to the split-off device so they start from 0. The corresponding gas_mixes.mix_index values should also be re-indexed.
Reproduction
- Merge a Halcyon dive with a Shearwater CCR dive (or any two devices with different gas mixes)
- Un-merge the dive
- View the Halcyon dive's depth profile chart — gas labels show "Gas 5" instead of "Gas 1"
Fix
In the split/un-merge code path, after partitioning samples and gas mixes by device, remap gasmixIndex on samples and mixIndex on gas mixes to be 0-based contiguous.
Priority
P3 — cosmetic issue, only affects dives that have been merged then un-merged.
Problem
After un-merging a dive (PR #129), the split-off dive retains remapped
gasmixIndexvalues from the merge. For example, a Halcyon dive that was merged with a Shearwater CCR dive (which had gas mixes at indices 0-3) has its samples remapped togasmixIndex = 4. After un-merging, the Shearwater gas mix records are removed but the Halcyon samples still reference index 4 — so the chart shows "Gas 5" instead of "Gas 1".Expected
When un-merging, the split logic should re-index
gasmixIndexon samples belonging to the split-off device so they start from 0. The correspondinggas_mixes.mix_indexvalues should also be re-indexed.Reproduction
Fix
In the split/un-merge code path, after partitioning samples and gas mixes by device, remap
gasmixIndexon samples andmixIndexon gas mixes to be 0-based contiguous.Priority
P3 — cosmetic issue, only affects dives that have been merged then un-merged.