Commit 3e17660
authored
[dwds] callServiceExtension should check all extensions and return kMethodNotFound when extension not found (#2597)
#2584
Currently, callServiceExtension checks the extensionRPCs field in the VM service. This list is populated when DWDS starts and checks the extensions currently registered in the runtime. This list is prone to becoming stale, however, as services may be registered or removed through the runtime (via dart:developer) later.
Instead, we should seek to always check the runtime for the current registered extensions and then update this list whenever we do. It’s still prone to becoming stale, but it is less stale. Ideally, we would override extensionRPCs and fetch the current registered extensions, but that isn’t possible since it requires awaiting a future. We also can’t ignore this field altogether because it looks like clients, like Dart DevTools, uses this field. Note that extensionRPCs should be a subset of getExtensionRpcs since registerService isn't supported in DWDS.
callServiceExtension should also return kMethodNotFound instead of its current JS evaluation error when an extension is not present.1 parent 8f146a1 commit 3e17660
File tree
4 files changed
+36
-5
lines changed- dwds
- lib/src
- debugging
- services
- test/common
4 files changed
+36
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
| 118 | + | |
120 | 119 | | |
121 | 120 | | |
122 | 121 | | |
| |||
760 | 759 | | |
761 | 760 | | |
762 | 761 | | |
763 | | - | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
764 | 768 | | |
765 | 769 | | |
766 | 770 | | |
767 | | - | |
| 771 | + | |
768 | 772 | | |
769 | 773 | | |
770 | 774 | | |
| |||
784 | 788 | | |
785 | 789 | | |
786 | 790 | | |
| 791 | + | |
787 | 792 | | |
788 | 793 | | |
789 | 794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
| 346 | + | |
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
| |||
509 | 509 | | |
510 | 510 | | |
511 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
512 | 519 | | |
513 | 520 | | |
514 | 521 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
301 | 315 | | |
302 | 316 | | |
303 | 317 | | |
| |||
0 commit comments