Skip to content

Conversation

@zacharyhamm
Copy link
Contributor

@zacharyhamm zacharyhamm commented Dec 18, 2025

Construct a DependencyGraph of all components via their ValueSubscription edges and use that to detect subscription cycles when a subscription is set.

How to test this: create a bunch of subscriptions. Try to create a cycle, see that it fails. See that normal subscriptions don't fail.

image

Note: once this deploys, any graph that currently has subscription cycles will no longer be able to have new subscriptions.

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions github-actions bot added the A-dal label Dec 18, 2025
nickgerace
nickgerace previously approved these changes Dec 18, 2025
Copy link
Contributor

@nickgerace nickgerace left a comment

Choose a reason for hiding this comment

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

This is awesome!

let prototype_id = AttributePrototypeArgument::prototype_id(ctx, apa_id).await?;
for av_id in AttributePrototype::attribute_value_ids(ctx, prototype_id).await? {
let subscriber_component_id = AttributeValue::component_id(ctx, av_id).await?;
// Don't add self-subscriptions
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

)
.await?;

assert_eq!(false, SubscriptionGraph::new(ctx).await?.is_cyclic());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert_eq!(false, SubscriptionGraph::new(ctx).await?.is_cyclic());
assert!(!SubscriptionGraph::new(ctx).await?.is_cyclic());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the two ! right next to each other don't make me happy :(

Copy link
Contributor

Choose a reason for hiding this comment

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

No biggie!

@nickgerace nickgerace dismissed their stale review December 18, 2025 22:49

Accidentally hit "approve" instead of "comment"!

@zacharyhamm zacharyhamm force-pushed the fix/subs branch 2 times, most recently from 38c031e to 29d389e Compare December 18, 2025 23:30
@zacharyhamm zacharyhamm marked this pull request as draft December 18, 2025 23:31
@zacharyhamm
Copy link
Contributor Author

There's a weird error here with attribute prototype arguments not having prototypes which gets hit when constructing the graph. Investigating

@zacharyhamm zacharyhamm force-pushed the fix/subs branch 2 times, most recently from 378d8be to 0716a89 Compare December 19, 2025 18:34
@github-actions github-actions bot added the A-sdf Area: Primary backend API service [Rust] label Dec 19, 2025
@zacharyhamm zacharyhamm marked this pull request as ready for review December 19, 2025 18:44
@zacharyhamm
Copy link
Contributor Author

/try

@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Okay, starting a try! I'll update this comment once it's running...
🚀 Try running here! 🚀

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

Labels

A-dal A-luminork A-sdf Area: Primary backend API service [Rust] A-web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants