MixinNetwork / MixinNetwork/flutter-plugins

Error sending live update: WindowChannelException(CHANNEL_UNREGISTERED, Channel "subwindow_channel" not accessible (may be unregistered, bidirectional pair, or permission denied))

Open
#489 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
512
Forks
292
Avg merge
15h 8m
Merged PRs (30d)
7

Description

I am unable to send an invokeMethod over a channel.
Whenever I try, the error from the title shows up.

I've ran this in a new project, this being the only dependency I use.
I have a button that runst he following code:

Future<void> _openOrUpdateSubWindow() async {
    setState(() {
      _counter++;
    });

    final payload = 'Patient Data Update #$_counter';
    final activeWindows = await WindowController.getAll();

    for (final controller in activeWindows) {
      final args = controller.arguments as String? ?? '';
      if (args.startsWith('subwindow')) {
        await controller.show();
        try {
          await _channel.invokeMethod('updateData', payload);
        } catch (e) {
          debugPrint('Error sending live update: $e');
        }
        return;
      }
    }

    final controller = await WindowController.create(
      WindowConfiguration(
        hiddenAtLaunch: false,
        arguments: 'subwindow:$payload',
      ),
    );

    await controller.show();
  }

It just doesn't update, and I get the debugPrint every single time.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported flow in a new project using _openOrUpdateSubWindow, WindowController.getAll/create, show, and _channel.invokeMethod('updateData'). Trace how the subwindow_channel is registered and how the updateData handler is connected; done means the existing subwindow receives the payload without CHANNEL_UNREGISTERED.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
desktop-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.