Skip to content

tabId is null when stream.send from background script #82

@hinryd

Description

@hinryd

Version

6.0.1

Current Behavior

When a stream is started by the content script, the tabId information in the endpoint data seems to get lost when it reaches the background script. Consequently, when attempting to send a message back to the content script using stream.send(), a TypeError is thrown.

I attempted a potential fix based on issue #66, which involved commenting out two specific lines of code. However, this resulted in an infinite loop in the aboutIncomingMessage function.

I'm not entirely familiar with the downstream logic, so any assistance in resolving this issue would be greatly appreciated.

Expected Behavior

stream.send() should send the message successfully

Steps To Reproduce

// content-script
const stream = openStream('test-channel', 'background')
// background
onOpenStreamChannel('test-channel', (stream) => {
  stream.onMessage((data) => {
    stream.send(data)
  })
})

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    🧐 Bug: Needs ConfirmationSomething isn't working, but needs to be confirmed by a team member.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions