Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtime safety checks when publishing to external topics #1703

Closed
Tracked by #1597
matt2e opened this issue Jun 7, 2024 · 0 comments · Fixed by #1736
Closed
Tracked by #1597

Add runtime safety checks when publishing to external topics #1703

matt2e opened this issue Jun 7, 2024 · 0 comments · Fixed by #1736

Comments

@matt2e
Copy link
Collaborator

matt2e commented Jun 7, 2024

Added compile time checks here: #1702

There are ways around the compile time checks, so we should also add runtime safety

@github-actions github-actions bot added the triage Issue needs triaging label Jun 7, 2024
@ftl-robot ftl-robot mentioned this issue Jun 7, 2024
@alecthomas alecthomas removed the triage Issue needs triaging label Jun 10, 2024
matt2e added a commit that referenced this issue Jun 11, 2024
Closes #1640
Checks for:
- publishing directly to an external module's exported topic
- directly calling an external module's verb, rather than using
`ftl.Call(...)`
- This already fails at runtime, but it's nice to have this as a compile
error

Both of these compile-time checks are not fool proof, any indirection
will mean these checks don't catch it. But it is good to catch what we
can.
eg:
```go
var extTopic = external.Topic
extTopic.Publish(...) // compiler believes this is a local topic
```
Added a separate issue for this for pubsub as it may not be as high a
priority: #1703
@matt2e matt2e closed this as completed in ff66550 Jun 12, 2024
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 a pull request may close this issue.

2 participants