Commit f5587a4
committed
[dwds] callServiceExtension should check all extensions and return kMethodNotFound when extension not found and remove reassemble from reload
#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. This is true for ext.flutter.reassemble, where DWDS
can not find the service because we computed the list too early.
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.
callServiceExtension should also return kMethodNotFound instead of its current
JS evaluation error when an extension is not present.
Lastly, the reassemble call is removed from reload as it can now be safely called in
Flutter tools instead.1 parent 8f146a1 commit f5587a4
File tree
5 files changed
+23
-48
lines changed- dwds
- lib/src
- debugging
- injected
- services
- web/reloader
5 files changed
+23
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
3 | 10 | | |
4 | 11 | | |
5 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
| |||
760 | 758 | | |
761 | 759 | | |
762 | 760 | | |
763 | | - | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
764 | 767 | | |
765 | 768 | | |
766 | 769 | | |
767 | | - | |
| 770 | + | |
768 | 771 | | |
769 | 772 | | |
770 | 773 | | |
| |||
784 | 787 | | |
785 | 788 | | |
786 | 789 | | |
| 790 | + | |
787 | 791 | | |
788 | 792 | | |
789 | 793 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| 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 | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 33 | | |
41 | 34 | | |
42 | 35 | | |
| |||
92 | 85 | | |
93 | 86 | | |
94 | 87 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 88 | | |
100 | 89 | | |
0 commit comments