Skip to content

fix(server): add bundled Fruma connections#52

Merged
OneNoted merged 1 commit into
mainfrom
dev
May 13, 2026
Merged

fix(server): add bundled Fruma connections#52
OneNoted merged 1 commit into
mainfrom
dev

Conversation

@OneNoted
Copy link
Copy Markdown
Owner

@OneNoted OneNoted commented May 13, 2026

Summary

  • Add bundled Fruma territory connection data from Wynnmap current supplemental territory data.
  • Preserve bundled Fruma resources while updating the bundled entries that Wynnmap now marks as double emeralds.
  • Sanitize supplemental connection data by removing self-connections and deduplicating merged edges.
  • Add coverage for Fruma connections, known connection targets, reciprocal bundled edges, external traversal, and connection merge behavior.

Why

Fruma territories had resource metadata but empty connection lists, so tower connection/external calculations and connection rendering had no graph edges to traverse.

Validation

  • cargo test -p sequoia-server extra_data_loader -- --nocapture
  • cargo check -p sequoia-server

Greptile Summary

This PR populates empty connection lists for Fruma territories, which previously caused tower-connection calculations and graph traversal to find no edges. It adds a new Royal Gate entry, upgrades three territories to double-emerald resources, and refactors the bundled data into a BundledTerritoryExtra struct that carries both resources and connections.

  • Connection merge semantics changed: merge_extra_data now additively merges connections from source into target (with deduplication and self-edge removal) instead of replacing them wholesale. A new sanitize_extra_data pass additionally cleans up any pre-existing remote connections after the merge.
  • New bundled data structure: bundled_territory_extra_data grows from 31 to 32 entries (adds Royal Gate), and three territories (Espren, Aldwell, Hyloch) switch to single_resource_with_emeralds to reflect Wynnmap's current double-emerald marking.
  • Test coverage: Six new unit tests validate Fruma connections, reciprocity of all internal edges, absence of self-connections, graph traversal, and the merge/deduplication logic.

Confidence Score: 5/5

Safe to merge — the changes are additive data and well-guarded logic with no observable regressions on existing code paths.

The merge-semantics change from replace to additive is intentional and covered by new tests. Both the error-recovery path and the happy path call sanitize after merge, so remote data with malformed connections is cleaned up in all scenarios. The static connection graph is validated by reciprocity, self-connection, and external-target tests. No changes touch authentication, persistence, or other sensitive paths.

No files require special attention.

Important Files Changed

Filename Overview
server/src/services/extra_data_loader.rs Adds Fruma connection graph, changes merge semantics from replace to additive, adds sanitize pass, and introduces BundledTerritoryExtra struct; well-tested and logically sound

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[run loop ticks] --> B{fetch remote data}
    B -- Ok --> C[load_extra_data]
    B -- Err --> D[write-lock extra_terr]

    C --> C1[fetch_extra_data from URL\nor empty HashMap]
    C1 --> C2[merge_extra_data\nbundled into remote]
    C2 --> C3[sanitize_extra_data\ndedup + remove self-edges]
    C3 --> C4[replace state.extra_terr]
    C4 --> E[mark dirty]

    D --> D1[merge_extra_data\nbundled into cached state]
    D1 --> D2[sanitize_extra_data]
    D2 --> E

    subgraph merge_extra_data
        M1[for each bundled territory] --> M2{target has resources?}
        M2 -- No --> M3[copy bundled resources]
        M2 -- Yes --> M4[keep remote resources]
        M3 --> M5[merge_connections\nappend + dedup + no self-loops]
        M4 --> M5
    end

    subgraph sanitize_extra_data
        S1[for each territory in map] --> S2[drain connections]
        S2 --> S3[filter self-edges\nand duplicates]
        S3 --> S4[reassign cleaned list]
    end
Loading

Reviews (1): Last reviewed commit: "fix(server): add bundled Fruma connectio..." | Re-trigger Greptile

@OneNoted OneNoted merged commit eb8073a into main May 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant