Skip to content

fix(connections): preserve tags on reconnect when no tags are provided#5723

Closed
hassan254-prog wants to merge 1 commit intomasterfrom
wari/preserve-tags-on-reconnects
Closed

fix(connections): preserve tags on reconnect when no tags are provided#5723
hassan254-prog wants to merge 1 commit intomasterfrom
wari/preserve-tags-on-reconnects

Conversation

@hassan254-prog
Copy link
Copy Markdown
Contributor

@hassan254-prog hassan254-prog commented Mar 26, 2026

Describe the problem and your solution

  • preserve tags on reconnect when no tags are provided

Fix reconnect tag preservation in upsertAuthConnection

This PR updates upsertAuthConnection to preserve existing connection tags when reconnecting with empty tags, while still replacing tags when non-empty values are provided. It also adds integration tests to validate both behaviors.


This summary was automatically generated by @propel-code-bot

@hassan254-prog hassan254-prog self-assigned this Mar 26, 2026
Copy link
Copy Markdown
Contributor

@propel-code-bot propel-code-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested changes highlight a potential regression in tag-clearing behavior when reconnecting with empty tags.

Status: Changes Suggested | Risk: Medium

Issues Identified & Suggestions
  • Clarify or add explicit tag-clearing mechanism for empty tags connection.service.ts
Review Details

📁 2 files reviewed | 💬 1 comments

Instruction Files
└── .claude/
    ├── agents/
    │   └── nango-docs-migrator.md
    └── skills

👍 / 👎 individual comments to help improve reviews for you

deleted: false,
deleted_at: null,
tags: tags ?? exists?.tags ?? {}
tags: tags && Object.keys(tags).length > 0 ? tags : (exists?.tags ?? {})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

[Logic] This change treats {} as “preserve existing tags.” That makes it impossible to clear tags by reconnecting with an empty object, which previously resulted in tags being cleared. If clients rely on clearing tags via {}, we need an explicit way to clear (e.g., tags: null or a separate preserveTags/clearTags flag) or update callers/docs accordingly. Is clearing tags still supported after this change?

Context for Agents
This change treats `{}` as “preserve existing tags.” That makes it impossible to clear tags by reconnecting with an empty object, which previously resulted in tags being cleared. If clients rely on clearing tags via `{}`, we need an explicit way to clear (e.g., `tags: null` or a separate `preserveTags`/`clearTags` flag) or update callers/docs accordingly. Is clearing tags still supported after this change?

File: packages/shared/lib/services/connection.service.ts
Line: 219

@hassan254-prog hassan254-prog marked this pull request as draft March 26, 2026 22:45
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