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

Connections from Queue.setConsumer are not shown in console #7180

Open
Chriscbr opened this issue Sep 30, 2024 · 0 comments
Open

Connections from Queue.setConsumer are not shown in console #7180

Chriscbr opened this issue Sep 30, 2024 · 0 comments
Labels
🐛 bug Something isn't working 🛫 console Console

Comments

@Chriscbr
Copy link
Contributor

Chriscbr commented Sep 30, 2024

I tried this:

bring cloud;

class MyService {
  queue: cloud.Queue;
  bucket: cloud.Bucket;
  new() {
    this.queue = new cloud.Queue();
    this.bucket = new cloud.Bucket();
    
    this.queue.setConsumer(inflight () => {
      this.doSomething();
    });
  }

  inflight doSomething() {
    this.bucket.put("test.json", "test");
  }
}

new MyService();

This happened:

Screenshot 2024-09-30 at 11 21 13 AM

There's a missing arrow / connection between Queue and Bucket.

Connection data:

{
  "version": "connections-0.1",
  "connections": [
    {
      "source": "root/Default/MyService/Queue",
      "sourceOp": "push",
      "target": "root/Default/MyService/Queue/Consumer0",
      "targetOp": "invoke",
      "name": "consumer"
    },
    {
      "source": "root/Default/MyService",
      "sourceOp": "doSomething",
      "target": "root/Default/MyService/Bucket",
      "targetOp": "put",
      "name": "call"
    },
    {
      "source": "root/Default/MyService/Queue/Consumer0",
      "sourceOp": "invoke",
      "target": "root/Default/MyService",
      "targetOp": "doSomething",
      "name": "call"
    },
    {
      "source": "root/Default/MyService/Queue/Consumer0",
      "sourceOp": "invokeAsync",
      "target": "root/Default/MyService",
      "targetOp": "doSomething",
      "name": "call"
    }
  ]
}

I expected this:

Screenshot 2024-09-30 at 11 21 53 AM

Is there a workaround?

If I remove the doSomething() method (and inline the logic instead) the arrow appears correctly.

bring cloud;

class MyService {
  queue: cloud.Queue;
  bucket: cloud.Bucket;
  new() {
    this.queue = new cloud.Queue();
    this.bucket = new cloud.Bucket();
    
    this.queue.setConsumer(inflight () => {
      this.bucket.put("test.json", "test");
    });
  }
}

new MyService();

Connection data:

{
  "version": "connections-0.1",
  "connections": [
    {
      "source": "root/Default/MyService/Queue",
      "sourceOp": "push",
      "target": "root/Default/MyService/Queue/Consumer0",
      "targetOp": "invoke",
      "name": "consumer"
    },
    {
      "source": "root/Default/MyService/Queue/Consumer0",
      "sourceOp": "invoke",
      "target": "root/Default/MyService/Bucket",
      "targetOp": "put",
      "name": "call"
    },
    {
      "source": "root/Default/MyService/Queue/Consumer0",
      "sourceOp": "invokeAsync",
      "target": "root/Default/MyService/Bucket",
      "targetOp": "put",
      "name": "call"
    }
  ]
}

Anything else?

No response

Wing Version

0.85.12

Node.js Version

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@Chriscbr Chriscbr added 🐛 bug Something isn't working 🛫 console Console labels Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🛫 console Console
Projects
None yet
Development

No branches or pull requests

1 participant