Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
1acef21 to
76df53f
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (2)
apps/server/src/api-data/automation/automation.dao.ts (1)
16-39: Preserve RuntimeStore fields when state is provided.When
stateis passed, the current construction enumerates specific fields and drops any other RuntimeStore keys that exist now or may be added later. Consider starting from a polled snapshot and overriding the state-derived fields to keep parity.♻️ Suggested refactor
export function getRuntimeStore(state?: RuntimeState): RuntimeStore { - if (!state) { - return eventStore.poll(); - } - const { message, auxtimer1, auxtimer2, auxtimer3, ping } = eventStore.poll(); + const store = eventStore.poll(); + if (!state) { + return store; + } const { clock, timer, rundown, offset, eventNow, eventNext, eventFlag, groupNow } = state; return { + ...store, clock, timer, - message, rundown, offset, eventNow, eventNext, eventFlag, groupNow, - auxtimer1, - auxtimer2, - auxtimer3, - ping, }; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/server/src/api-data/automation/automation.dao.ts` around lines 16 - 39, getRuntimeStore currently builds the returned RuntimeStore from scratch when a RuntimeState is provided, which drops any extra keys from the polled snapshot; instead call eventStore.poll() first and merge/override only the state-driven fields so all existing and future RuntimeStore keys are preserved. Modify getRuntimeStore to obtain a polled snapshot via eventStore.poll(), then return an object that spreads that snapshot and assigns/overrides the fields derived from the passed-in RuntimeState (clock, timer, rundown, offset, eventNow, eventNext, eventFlag, groupNow) so no polled properties are lost.apps/server/src/api-data/automation/clients/http.client.ts (1)
11-19: Renamestateparameter tostorefor consistency.The helper now operates on the store; aligning the parameter name avoids confusion.
✏️ Suggested rename
-function preparePayload(output: HTTPOutput, state: DeepReadonly<RuntimeStore>): string { - const parsedUrl = parseTemplateNested(output.url, state); +function preparePayload(output: HTTPOutput, store: DeepReadonly<RuntimeStore>): string { + const parsedUrl = parseTemplateNested(output.url, store); return parsedUrl; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/server/src/api-data/automation/clients/http.client.ts` around lines 11 - 19, The preparePayload helper uses a parameter named state but callers and surrounding code use store; rename the function parameter from state to store in the preparePayload declaration and any internal references so it matches emitHTTP’s call signature and naming conventions (function preparePayload(output: HTTPOutput, store: DeepReadonly<RuntimeStore>) and usages inside preparePayload such as parseTemplateNested(output.url, store)). Ensure no other references to the old parameter name remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@apps/server/src/api-data/automation/automation.dao.ts`:
- Around line 16-39: getRuntimeStore currently builds the returned RuntimeStore
from scratch when a RuntimeState is provided, which drops any extra keys from
the polled snapshot; instead call eventStore.poll() first and merge/override
only the state-driven fields so all existing and future RuntimeStore keys are
preserved. Modify getRuntimeStore to obtain a polled snapshot via
eventStore.poll(), then return an object that spreads that snapshot and
assigns/overrides the fields derived from the passed-in RuntimeState (clock,
timer, rundown, offset, eventNow, eventNext, eventFlag, groupNow) so no polled
properties are lost.
In `@apps/server/src/api-data/automation/clients/http.client.ts`:
- Around line 11-19: The preparePayload helper uses a parameter named state but
callers and surrounding code use store; rename the function parameter from state
to store in the preparePayload declaration and any internal references so it
matches emitHTTP’s call signature and naming conventions (function
preparePayload(output: HTTPOutput, store: DeepReadonly<RuntimeStore>) and usages
inside preparePayload such as parseTemplateNested(output.url, store)). Ensure no
other references to the old parameter name remain.
76df53f to
b72e61a
Compare
c29e2f7 to
bae9daf
Compare
bae9daf to
cfc7b58
Compare
No description provided.