Skip to content

Un-merge should remap gasmixIndex back to 0-based #133

Description

@shaheinm

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

  1. Merge a Halcyon dive with a Shearwater CCR dive (or any two devices with different gas mixes)
  2. Un-merge the dive
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions