Commit a8a0e0c
Move hook input deserialization next to the cast that types it
normalizeHookInput lived in client.ts and inspected for a 'timestamp'
property by name, which felt magical (brittle against any future
hook-shaped wire payload that happens to contain a numeric 'timestamp').
Move the conversion into CopilotSession._handleHooksInvoke, renamed
deserializeHookInput, right next to the GenericHandler cast that says
'this unknown is now a HookInput'. That's the only call site that
actually knows the payload is a hook input, so it's the correct boundary
for the schema transform.
This is the TS equivalent of what C# does via
UnixMillisecondsDateTimeOffsetConverter (attached per-property on each
HookInput.Timestamp); TS just plumbs the same conversion through the
hooks dispatcher instead of a per-type JSON converter.
Verified 3/3 hooks_extended.e2e tests pass locally.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 11df3b1 commit a8a0e0c
2 files changed
Lines changed: 27 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | 90 | | |
108 | 91 | | |
109 | 92 | | |
| |||
2059 | 2042 | | |
2060 | 2043 | | |
2061 | 2044 | | |
2062 | | - | |
2063 | | - | |
2064 | | - | |
2065 | | - | |
| 2045 | + | |
2066 | 2046 | | |
2067 | 2047 | | |
2068 | 2048 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
57 | 74 | | |
58 | 75 | | |
59 | 76 | | |
| |||
955 | 972 | | |
956 | 973 | | |
957 | 974 | | |
958 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
959 | 983 | | |
960 | 984 | | |
961 | 985 | | |
| |||
976 | 1000 | | |
977 | 1001 | | |
978 | 1002 | | |
979 | | - | |
| 1003 | + | |
980 | 1004 | | |
981 | 1005 | | |
982 | 1006 | | |
| |||
0 commit comments