feat: Add debugName parameter to YAJsonIsolate.#1118
feat: Add debugName parameter to YAJsonIsolate.#1118Vinzent03 merged 2 commits intosupabase:mainfrom misha:main
Conversation
Pull Request Test Coverage Report for Build 13339988921Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
|
Thanks for the PR! A test would be great! I don't think we need to worry about the web implementation! |
|
I'm pretty sure we have to change the web part as well. Otherwise the signature is different and the build should fail for web. |
Can you mention how the test should be implemented? The only way I can think to test this is to store the
Yep, that sounds right to me. I added a commit to make the constructor signatures identical. |
Vinzent03
left a comment
There was a problem hiding this comment.
I don't think this requires any further tests. The parameter is only passed to the spawn method. So it should be fine.
What kind of change does this PR introduce?
This is a new feature for
YAJsonIsolate.In testing environments, it's easy to have multiple clients open. Specifically, I usually have an admin client and a client for the current user, but I can't tell which is which because all isolates have the same name. When an error occurs in the isolate, it takes a lot of effort to figure out which client produced it.
I would like to be able to rename isolates, specifically for use in debugging.
What is the current behavior?
Currently, all isolates spawned have the name
_compute.Here's a screenshot of what it looks like in VSCode.
What is the new behavior?
There's now a
debugNameconstructor parameter onYAJsonIsolate. The user can add the library to their package and instantiate an instance with their desireddebugNameif they want to access it.Here's a screenshot of what it looks like in VSCode, after setting the name to
my_isolate.Additional context
Two questions:
_isolates_web.dart. Does this now need the same (albeit unused) constructor parameter?Isolateinstance to verify it gets created with the specifieddebugName, but then I have to remember to unassign it so I'd rather just not store it. If a test is required, let me know what it should do.