ontime icon indicating copy to clipboard operation
ontime copied to clipboard

wip: strict nullcheck

Open alex-Arc opened this issue 8 months ago • 4 comments

#560

alex-Arc avatar Oct 28 '23 14:10 alex-Arc

Hi @alex-Arc, this looks correct, but it is strange that typescript let this pass. Are you able to investigate why is are the values not being correctly typed as potentially null?

the return of getRollTimers should be typed as

  nowIndex: number | null;
  nowId: string | null;
  publicIndex: number | null;
  nextIndex: number | null;
  publicNextIndex: number | null;
  timeToNext: number | null;
  nextEvent: OntimeEvent | null;
  nextPublicEvent: OntimeEvent | null;
  currentEvent: OntimeEvent | null;
  currentPublicEvent: OntimeEvent | null;

Once this is done typescript will throw errors if we don't handle the null cases

cpvalente avatar Oct 28 '23 16:10 cpvalente

[!IMPORTANT]

Auto Review Skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository.

To trigger a single review, invoke the @coderabbitai review command.


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.
  • @coderabbitai resolve to resolve all the CodeRabbit review comments.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

coderabbitai[bot] avatar Nov 09 '23 20:11 coderabbitai[bot]

@cpvalente do we need this branch or did it get fixed else where?

alex-Arc avatar Dec 08 '23 18:12 alex-Arc

Hi @alex-Arc , this work was paused to avoid merge conflicts with the work in over-under I will leave it here for reference but the fix was already done in another merge

thanks for checking in

cpvalente avatar Dec 08 '23 20:12 cpvalente