Skip to content

[scd] Create attached subscription after checking for conflicts - #1797

Merged
MariemBaccari merged 1 commit into
interuss:masterfrom
Orbitalize:fix_implicit_sub
Oct 20, 2026
Merged

MariemBaccari merged 1 commit into
interuss:masterfrom
Orbitalize:fix_implicit_sub

Conversation

@MariemBaccari

@MariemBaccari MariemBaccari commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

This PR aims to address #1792 by fixing the bug introduced in #1690.
Currently, implicit subscriptions can be persisted despite there being an airspace conflict response. This is due to the fact that these are no longer returned as errors and, therefore, do not trigger a transaction rollback.
This PR fixes this by writing the attached subscription after finishing the conflict checks.

@mickmis mickmis left a comment

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.

The change in itself LGTM, but this complexifies a bit further the control flow of this function which is already in a bad state. Maybe there is something to be done by factoring away figuring out attachedSub. E.g. extracting a function:

func resolveSubscription(ctx, repo, previousSub, manager, validParams) (attachedSub, upsertAttachedSub, removePreviousImplicitSubscription, error)

WDYT? Can be done in follow-up PR if you agree.

Comment thread pkg/scd/operations/operational_intents.go
Comment thread pkg/scd/operations/operational_intents.go Outdated
@MariemBaccari
MariemBaccari merged commit 998d6ad into interuss:master Oct 20, 2026
20 checks passed
@MariemBaccari

Copy link
Copy Markdown
Contributor Author

@mickmis I opened #1800 but kept removePreviousImplicitSubscription outside of it to avoid having 2 return bool values.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants