Skip to content

Harden export token checks, remap analysis IDs, and seed the settings device#9

Open
mateuscardosodeveloper wants to merge 2 commits into
masterfrom
fix/export-token-analysis-settings-seed
Open

Harden export token checks, remap analysis IDs, and seed the settings device#9
mateuscardosodeveloper wants to merge 2 commits into
masterfrom
fix/export-token-analysis-settings-seed

Conversation

@mateuscardosodeveloper

@mateuscardosodeveloper mateuscardosodeveloper commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes four issues in the Kickstarter export flow: token validation that broke
on the new p- prefixed token format, stale analysis ID references in env vars
after export, a missing default alert configuration on the settings device of
the Default Kickstarter, and TagoRUN custom_fields (Custom Settings for Users)
not being copied to the target profile.

Why

The backend changed the token format to add a p- prefix, which changed its
length and tripped the old fixed-length check. Separately, [TagoIO] - CRUD Alerts stores the [TagoIO] - Alert Dispatch analysis ID in an env var; the
export never remapped analysis IDs, so the Action it creates ended up with no
analysis selected. The Default Kickstarter also shipped without a working
global-inactivity alert. Finally, the RUN export read custom_fields from the
target profile and wrote it straight back (a no-op), so the source profile's
custom user fields were never carried over.

Test plan

  • Export the Default Kickstarter with a p- prefixed import token; export proceeds past validation
  • After export, open [TagoIO] - CRUD Alerts in the target profile and confirm alert_dispatcher_id points to the new [TagoIO] - Alert Dispatch analysis
  • Confirm the Action created by CRUD Alerts has the analysis selected
  • Confirm the settings device (device_type=settings) in a freshly created Default profile carries the global-inactivity group data
  • Re-export into an existing profile and confirm the seed is not re-sent (create-only)
  • Export a non-Default application and confirm no seed is sent
  • After export, confirm the target profile's RUN Custom Settings for Users matches the source custom_fields

Risk (CIA)

Likelihood: 🟢 Low | Impact: 🟢 Low | Exposure: 🟢 Low

…evice

Validate tokens by behavior instead of a fixed length so the new p- prefixed
format passes; the import token is now confirmed against a live run.info call.

Build the full analysis old->new ID map before writing any variables so env
vars that reference another analysis (CRUD Alerts' alert_dispatcher_id) resolve
to the new analysis regardless of export order. Also preserve run_on, interval
and description on the recreated analysis.

Seed the default global-inactivity alert into the freshly created settings
device when exporting the Default Kickstarter, identified by the
device_type=settings tag.
@mateuscardosodeveloper mateuscardosodeveloper added the bug Something isn't working label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant