Commit d5e59d9
[Conversation history] Fix serialization of conversations
Currently, `Conversation.serialize()` leaves the `confirm()` function
of responses of type side-effect unchanged. Consequently, in
`AiHistoryStorage.upsertHistoryEntry()` the `confirm()` function is
persisted in a DevTools setting (only in the setting's in-memory copy,
the copy persisted to storage is stringified which removes the
`confirm()` function).
When the setting is later accessed, `structuredClone()` is executed on
it, which throws when encountering a function.
This bug does not surface in the current implementation of the
`AiAssistancePanel` because the setting is only accessed once, in the
panel's constructor. Current refactoring efforts will change this,
and the conversation serialization needs to be fixed first.
Bug: 427407133
Change-Id: Ib620878245530a5086668a414c85bd70b8be31cf
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6827303
Commit-Queue: Alex Rudenko <[email protected]>
Auto-Submit: Wolfgang Beyer <[email protected]>
Reviewed-by: Alex Rudenko <[email protected]>1 parent 298735c commit d5e59d9
File tree
4 files changed
+25
-8
lines changed- front_end
- models/ai_assistance
- agents
- panels/ai_assistance
4 files changed
+25
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
514 | | - | |
515 | | - | |
| 513 | + | |
| 514 | + | |
516 | 515 | | |
517 | 516 | | |
518 | 517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
126 | 141 | | |
127 | 142 | | |
128 | 143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
110 | 114 | | |
111 | 115 | | |
112 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
560 | | - | |
561 | | - | |
562 | | - | |
| 560 | + | |
| 561 | + | |
563 | 562 | | |
564 | 563 | | |
565 | 564 | | |
| |||
0 commit comments