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

[flutter_local_notifications_windows] Fix URIs on Windows -- images and audio #2511

Merged
merged 37 commits into from
Jan 2, 2025

Conversation

Levi-Lesches
Copy link
Contributor

@Levi-Lesches Levi-Lesches commented Dec 31, 2024

Windows custom audio and image support wasn't very well tested, and #2510 reported that it doesn't even work in its current state.

This PR:

Fixes #2510

@Levi-Lesches Levi-Lesches marked this pull request as ready for review December 31, 2024 06:14
@Levi-Lesches
Copy link
Contributor Author

Levi-Lesches commented Dec 31, 2024

Not sure why the CI is failing -- here's my local output:

What would you like me to do? flutter test -r expanded
00:00 +0: loading D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart
00:00 +0: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart: Bindings (setUpAll)
00:00 +0: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart: Bindings work in simple cases
00:00 +1: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart: Bindings fail when ID is not found in simple cases
00:00 +2: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart: Bindings are included in show()
00:00 +3: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: (setUpAll)
00:00 +3: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart: Bindings fail when notification has been cancelled
00:00 +4: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart: Bindings fail when notification has been cancelled
00:00 +5: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Simple details
00:00 +6: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin (setUpAll)
00:00 +6: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Actions
00:00 +7: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin initializes safely
00:00 +8: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Audio
00:00 +9: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Audio
00:00 +10: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin cannot be used before initializing
00:00 +11: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Rows
00:00 +12: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Rows
00:00 +13: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Rows
00:00 +14: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart: Schedules (setUpAll)
00:00 +15: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart: Schedules (setUpAll)
00:00 +16: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart: Schedules (setUpAll)
00:00 +16: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Inputs
00:00 +17: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart: Schedules work with basic times
00:00 +18: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Progress
00:00 +19: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Progress
00:00 +20: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Progress
00:00 +20 -1: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Progress [E]
  Expected: NotificationUpdateResult:<NotificationUpdateResult.success>
    Actual: NotificationUpdateResult:<NotificationUpdateResult.notFound>

  package:matcher                expect
  test\details_test.dart 243:11  main.<fn>.<fn>

Retry: Details: Progress
00:01 +21: D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: (tearDownAll)
00:01 +21: All tests passed!

@MaikuB
Copy link
Owner

MaikuB commented Dec 31, 2024

I'm not sure why it's failing as well but seems like some tests are failing to completely run

@MaikuB
Copy link
Owner

MaikuB commented Dec 31, 2024

Actually from the output you've shared from running it locally, it still has an exit code of 1 so that would be why. Not sure why that is happening but if that's fixed locally then that would most likely fix the issue

@Levi-Lesches
Copy link
Contributor Author

Levi-Lesches commented Dec 31, 2024

I went back and re-worked things slightly based on your action-image comment: both WindowsImage and WindowsAction now support any Uri in the constructor, with an extensive docs page on when to use which kind of URI, and a function WindowsImage.assetUri() that gives you a safe URI of any Flutter asset. This can actually be replaced by Msix.assetUri() if YehudaKremer/msix#293 gets merged and published.

I also updated my previous message with my actual (successful) test output on my own laptop. The GitHub version is weird -- despite saying 11 tests passed with no failures, it's actually running 21 tests, and they're all successful. The tests themselves are inherently flaky, and while they were good to see if the Windows APIs wouldn't freak out, I'm not sure they're actually helping at this point. While it's important to test Dart-to-native communication, most of that is handled by FFI, so the rest of the tests are just causing notifications to appear on a headless server. Perhaps I should make a new PR to remove most of the tests and just test that we're sending the right XML instead.

I'm also open to renaming everything WindowsNotificationSomething to be consistent. It might be good to get that out before the pre-releases go stable.

@MaikuB
Copy link
Owner

MaikuB commented Dec 31, 2024

I'm going to push a change to temporarily enable verbose logging on the tests to see if it might provide more info on what's going on

@MaikuB
Copy link
Owner

MaikuB commented Dec 31, 2024

Actually I probably won't need to do that anymore. I've pasted the output below

PS C:\flutter_local_notifications\flutter_local_notifications_windows> flutter test
00:06 +19 -1: C:/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Progress [E]
  Expected: NotificationUpdateResult:<NotificationUpdateResult.success>
    Actual: NotificationUpdateResult:<NotificationUpdateResult.notFound>

  package:matcher                expect
  test\details_test.dart 243:11  main.<fn>.<fn>

00:06 +19 -1: C:/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Progress
Retry: Details: Progress
00:07 +19 -1: C:/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Progress [E]
  Expected: NotificationUpdateResult:<NotificationUpdateResult.success>
    Actual: NotificationUpdateResult:<NotificationUpdateResult.notFound>

  package:matcher                expect
  test\details_test.dart 243:11  main.<fn>.<fn>

Retry: Details: Progress
00:08 +20 -1: C:/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart: Details: Progress [E]
  Expected: NotificationUpdateResult:<NotificationUpdateResult.success>
    Actual: NotificationUpdateResult:<NotificationUpdateResult.notFound>

  package:matcher                expect
  test\details_test.dart 243:11  main.<fn>.<fn>

Retry: Details: Progress
00:08 +21: All tests passed!

The summary says all tests pass but it actually picked up differences between the expected and actual values. I could be wrong as it's been a while but I don't recall this being an issue before. Perhaps this is the reason why GitHub found issues?

Edit: actually the output from GitHub is green for this so perhaps isn't related. I'll push verbose logging anyway

@Levi-Lesches
Copy link
Contributor Author

Well, I didn't get anything interesting by checking out the lines the stack trace is referring to. The tests pass, no errors occur, but the exit code is being set somewhere to a non-zero value. But it's using the global variable so it's a little hard to follow the logic.

@MaikuB
Copy link
Owner

MaikuB commented Dec 31, 2024

I also took a look at the verbose logs and looks like the tooling is crapping out. Not sure why but may have to ignore this for now. As for verifying the changes in the PR, I've tried to create the MSIX for the example but can't install it. I changed the MSIX config to install the cert too but that didn't help. Any pointers?

@Levi-Lesches
Copy link
Contributor Author

Levi-Lesches commented Dec 31, 2024

If you're getting the "untrusted certificate" error, or something like that when trying to install a valid msix, that's normal:

  • Right click on the msix, click Properties
  • digital signatures tab, choose Levi Lesches, click Details
  • click View Certificate, then Install Certificate
  • Install the certificate in Local Machine, then click Browse and choose Trusted Root

It seems to be another deterrent to stop people from running unsigned code. Users who actually have a valid and not just self-signed MSIX certificate won't run into these issues (I might consider opening a PR to package:msix to record these instructions on their README)

@Levi-Lesches Levi-Lesches marked this pull request as ready for review January 1, 2025 15:53
@Levi-Lesches
Copy link
Contributor Author

Levi-Lesches commented Jan 1, 2025

I figured out the flaky test problem! Locally, the tests run together. On CI, the tests are interrupted and the process is shut down early. Checking the Dart and C++ code, and cross-referencing that with what else works on CI, my guess is that one of these two lines is causing the crash:

  ScheduledToastNotification notification(doc, winrt::clock::from_time_t(time));
  plugin->notifier.value().AddToSchedule(notification);

And somehow the Flutter tooling isn't picking it up as a failed test. Then, when it reaches the end and notices that a test didn't finish properly somewhere, it exits with a failure. I'll try to report this to the Flutter team soon, but for now I deleted that test, so everything passes now. I was also able to get -j 1 working, which runs the tests sequentially, and got it down to 0 retries, so it should "just work" every time now.

Broken test
// test/scheduled_test.dart
test('work with basic times', skip: true, () async {
  await plugin.cancelAll();
  expect(await countPending(), 0);
  final TZDateTime now = TZDateTime.now(location);
  final TZDateTime later = now.add(const Duration(days: 1));
  expect(plugin.zonedSchedule(300, null, null, later, null), completes);
  expect(await countPending(), 1);
  expect(plugin.zonedSchedule(301, null, null, later, null), completes);
  expect(await countPending(), 2);
  expect(plugin.zonedSchedule(302, null, null, later, null), completes);
  expect(await countPending(), 3);
  await plugin.cancelAll();
  expect(await countPending(), 0);
});
Local output
[   +6 ms] test 3: Started flutter_tester process at pid 20056
[ +180 ms] test 3: connected to test device, now awaiting test result
[   +1 ms] test 3: Waiting for test harness or tests to finish
✅ D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart: Schedules work with basic times
✅ D:/Flutter/Packages/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart: Schedules do not work with earlier time
[ +191 ms] test 3: Test harness is no longer needed by test process
[        ] test 3: finished
[   +1 ms] test 3: cleaning up...
[        ] test 3: ensuring test device is terminated.
[        ] test 3: Terminating flutter_tester process
[        ] test 3: Shutting down DevTools server
[        ] test 3: Test process is no longer needed by test harness
[        ] test 3: Shutting down test harness socket server
[   +6 ms] test 3: flutter_tester process at pid 20056 exited with code=-1
[        ] test 3: deleting temporary directory
[   +2 ms] test 3: finished
CI output
[   +2 ms] test 3: Started flutter_tester process at pid 4008
[ +189 ms] test 3: connected to test device, now awaiting test result
[        ] test 3: Waiting for test harness or tests to finish
✅ d:/a/flutter_local_notifications/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart: Schedules work with basic times
[+1226 ms] test 3: Test process is no longer needed by test harness
[        ] test 3: finished
[        ] test 3: cleaning up...
[        ] test 3: ensuring test device is terminated.
[        ] test 3: Terminating flutter_tester process
[        ] test 3: Shutting down DevTools server
[        ] test 3: Test harness is no longer needed by test process
✅ d:/a/flutter_local_notifications/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart: Schedules do not work with earlier time
[        ] test 3: Shutting down test harness socket server
[        ] Compiling file:///C:/Users/RUNNER~1/AppData/Local/Temp/flutter_tools.bce9bb2d/flutter_test_listener.20e0f0d4/listener.dart
[   +3 ms] test 3: flutter_tester process at pid 4008 exited with code=-1073740791
[        ] test 3: deleting temporary directory
[   +1 ms] test 3: finished

I also updated the example, so feel free to merge. The Android integration test should just need a re-run

@Levi-Lesches Levi-Lesches requested a review from MaikuB January 2, 2025 04:42
@MaikuB
Copy link
Owner

MaikuB commented Jan 2, 2025

Whilst PR is green I'm getting the following output from running the tests locally

melos run test:unit:windows
  └> melos exec -c 1 -- "flutter test -j 1"
     └> RUNNING

$ melos exec
  └> flutter test -j 1
     └> RUNNING (in 1 packages)

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
flutter_local_notifications_windows:
00:00 +0: loading c:/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart
00:00 +0 -1: loading c:/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart [E]
  Failed to load "c:/flutter_local_notifications/flutter_local_notifications_windows/test/bindings_test.dart":
  Invalid argument(s): Failed to load dynamic library 'flutter_local_notifications_windows.dll': %1 is not a valid Win32 application.
   (error code: 193)
  dart:ffi                                                               new DynamicLibrary.open
  package:flutter_local_notifications_windows/src/plugin/ffi.dart 44:22  new FlutterLocalNotificationsWindows
  test\bindings_test.dart 18:11                                          main.<fn>
  package:test_api                                                       Declarer.group
  package:test_core/src/scaffolding.dart 224:13                          group
  test\bindings_test.dart 15:16                                          main

00:00 +0 -1: loading c:/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart
00:00 +0 -2: loading c:/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart [E]
  Failed to load "c:/flutter_local_notifications/flutter_local_notifications_windows/test/details_test.dart":
  Invalid argument(s): Failed to load dynamic library 'flutter_local_notifications_windows.dll': %1 is not a valid Win32 application.
   (error code: 193)
  dart:ffi                                                               new DynamicLibrary.open
  package:flutter_local_notifications_windows/src/plugin/ffi.dart 44:22  new FlutterLocalNotificationsWindows
  test\details_test.dart 30:11                                           main.<fn>
  package:test_api                                                       Declarer.group
  package:test_core/src/scaffolding.dart 224:13                          group
  test\details_test.dart 27:16                                           main

00:00 +0 -2: loading c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart
00:00 +0 -2: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin (setUpAll)
00:00 +0 -2: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin initializes safely
00:00 +0 -3: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin initializes safely [E]
  Invalid argument(s): Failed to load dynamic library 'flutter_local_notifications_windows.dll': %1 is not a valid Win32 application.
   (error code: 193)
  dart:ffi                                                               new DynamicLibrary.open
  package:flutter_local_notifications_windows/src/plugin/ffi.dart 44:22  new FlutterLocalNotificationsWindows
  test\plugin_test.dart 27:13                                            main.<fn>.<fn>

00:00 +0 -3: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin catches bad GUIDs
00:00 +0 -4: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin catches bad GUIDs [E]
  Invalid argument(s): Failed to load dynamic library 'flutter_local_notifications_windows.dll': %1 is not a valid Win32 application.
   (error code: 193)
  dart:ffi                                                               new DynamicLibrary.open
  package:flutter_local_notifications_windows/src/plugin/ffi.dart 44:22  new FlutterLocalNotificationsWindows
  test\plugin_test.dart 35:13                                            main.<fn>.<fn>

00:00 +0 -4: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin cannot be used before initializing
00:00 +0 -5: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin cannot be used before initializing [E]
  Invalid argument(s): Failed to load dynamic library 'flutter_local_notifications_windows.dll': %1 is not a valid Win32 application.
   (error code: 193)
  dart:ffi                                                               new DynamicLibrary.open
  package:flutter_local_notifications_windows/src/plugin/ffi.dart 44:22  new FlutterLocalNotificationsWindows
  test\plugin_test.dart 42:13                                            main.<fn>.<fn>

00:00 +0 -5: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin cannot be used after disposed
00:00 +0 -6: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin cannot be used after disposed [E]
  Invalid argument(s): Failed to load dynamic library 'flutter_local_notifications_windows.dll': %1 is not a valid Win32 application.
   (error code: 193)
  dart:ffi                                                               new DynamicLibrary.open
  package:flutter_local_notifications_windows/src/plugin/ffi.dart 44:22  new FlutterLocalNotificationsWindows
  test\plugin_test.dart 70:13                                            main.<fn>.<fn>

00:00 +0 -6: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin does not support repeating notifications
00:00 +0 -7: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin does not support repeating notifications [E]
  Invalid argument(s): Failed to load dynamic library 'flutter_local_notifications_windows.dll': %1 is not a valid Win32 application.
   (error code: 193)
  dart:ffi                                                               new DynamicLibrary.open
  package:flutter_local_notifications_windows/src/plugin/ffi.dart 44:22  new FlutterLocalNotificationsWindows
  test\plugin_test.dart 98:13                                            main.<fn>.<fn>

00:00 +0 -7: c:/flutter_local_notifications/flutter_local_notifications_windows/test/plugin_test.dart: Plugin (tearDownAll)
00:00 +0 -7: loading c:/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart
00:01 +0 -8: loading c:/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart [E]
  Failed to load "c:/flutter_local_notifications/flutter_local_notifications_windows/test/scheduled_test.dart":
  Invalid argument(s): Failed to load dynamic library 'flutter_local_notifications_windows.dll': %1 is not a valid Win32 application.
   (error code: 193)
  dart:ffi                                                               new DynamicLibrary.open
  package:flutter_local_notifications_windows/src/plugin/ffi.dart 44:22  new FlutterLocalNotificationsWindows
  test\scheduled_test.dart 13:11                                         main.<fn>
  package:test_api                                                       Declarer.group
  package:test_core/src/scaffolding.dart 224:13                          group
  test\scheduled_test.dart 11:16                                         main

00:01 +0 -8: loading c:/flutter_local_notifications/flutter_local_notifications_windows/test/xml_test.dart
00:01 +0 -9: loading c:/flutter_local_notifications/flutter_local_notifications_windows/test/xml_test.dart [E]
  Failed to load "c:/flutter_local_notifications/flutter_local_notifications_windows/test/xml_test.dart":
  Invalid argument(s): Failed to load dynamic library 'flutter_local_notifications_windows.dll': %1 is not a valid Win32 application.
   (error code: 193)
  dart:ffi                                                               new DynamicLibrary.open
  package:flutter_local_notifications_windows/src/plugin/ffi.dart 44:22  new FlutterLocalNotificationsWindows
  test\xml_test.dart 66:9                                                main.<fn>
  package:test_api                                                       Declarer.group
  package:test_core/src/scaffolding.dart 224:13                          group
  test\xml_test.dart 62:3                                                main

00:01 +0 -9: Some tests failed.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

$ melos exec
  └> flutter test -j 1
     └> FAILED (in 1 packages)
        └> flutter_local_notifications_windows (with exit code 1)

melos run test:unit:windows
  └> melos exec -c 1 -- "flutter test -j 1"
     └> FAILED
ScriptException: The script test:unit:windows failed to execute.

@Levi-Lesches
Copy link
Contributor Author

Interesting, mine works fine:

$ flutter test -j 1
00:03 +20: All tests passed!

Google searches indicate you're trying to load a 32-bit DLL -- can you delete it and try running build.bat again? Try to see from the CMake output if it's 64 or 32 bit

@MaikuB
Copy link
Owner

MaikuB commented Jan 2, 2025

This is the output

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- The CXX compiler identification is MSVC 19.42.34433.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.42.34433/bin/Hostarm64/arm64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:18 (set):
  Cannot set "flutter_local_notifications_windows_bundled_libraries": current
  scope has no parent.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done (1.5s)
-- Generating done (0.0s)
-- Build files have been written to: C:/flutter_local_notifications/flutter_local_notifications_windows/build
MSBuild version 17.12.6+db5f6012c for .NET Framework

  1>Checking Build System
  Building Custom Rule C:/flutter_local_notifications/flutter_local_notifications_windows/src/CMakeLists.txt
  ffi_api.cpp
  plugin.cpp
  utils.cpp
  Generating Code...
     Creating library C:/flutter_local_notifications/flutter_local_notifications_windows/build/shared/Debug/flutter_local_notifications_windows.lib and object C:/flutter_local_notifica
  tions/flutter_local_notifications_windows/build/shared/Debug/flutter_local_notifications_windows.exp
  flutter_local_notifications_windows.vcxproj -> C:\flutter_local_notifications\flutter_local_notifications_windows\build\shared\Debug\flutter_local_notifications_windows.dll
  Building Custom Rule C:/flutter_local_notifications/flutter_local_notifications_windows/windows/CMakeLists.txt
        1 file(s) copied.

I'm assuming it's building from ARM64 (note: I'm running Windows 11 via Parallels on my M2 MacBook). I went back to earlier commits, even on master and still have the same issue so wonder if I've forgotten that there was a trick that I had to get it working before that I've forgotten about. I might have ignore this for now and figure out a different approach e.g. get a 32 bit DLL elsewhere.

On a different note, when doing a searching through your current fork, there's still some references to the enableMultithreading() method, most are ones that are commented out from the test that can be removed but others from actual code

image

@Levi-Lesches
Copy link
Contributor Author

I'm assuming it's building from ARM64 (note: I'm running Windows 11 via Parallels on my M2 MacBook).

Interesting. Not sure how you were doing that before but I can send you the 64-bit DLL if you need.

there's still some references to the enableMultithreading() method

Thanks 🤦, removed from the C++ side as well

@MaikuB MaikuB merged commit f015afc into MaikuB:master Jan 2, 2025
17 checks passed
@Levi-Lesches Levi-Lesches deleted the windows-uris branch January 2, 2025 06:05
@Levi-Lesches Levi-Lesches restored the windows-uris branch January 2, 2025 06:05
expect(plugin.showRawXml(id: 5, xml: complexXml), completes);
});
test('catches invalid XML', () async {
expect(plugin.isValidXml(emptyXml), isFalse);
Copy link
Owner

Choose a reason for hiding this comment

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

Something I picked up after merging but these are all meant to be separate tests as there's a different permutations of input and output but have made as part of a single test(). The description given is also misleading as there are tests that assert valid XML was provided and is more appropriate as a group description. I noticed there are other test classes that are like this too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I plan to re-organize the tests, and have more thorough ones. For example, while there are tests to make sure the APIs can distinguish between valid and invalid XML, and tests to make sure the WindowsNotificationsDetails generates valid XML, there are no tests to map WindowsNotificationDetails to specific XML, eg, to verify that a progress bar is actually inserted. Another PR for another day :)

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 this pull request may close these issues.

[Windows] How to play a custom sound?
2 participants