Skip to content

Conversation

@dhairyashiil
Copy link
Member

@dhairyashiil dhairyashiil commented Jan 17, 2026

What does this PR do?

Fixes a critical bug causing iOS and Android companion apps to crash when opening the availability detail page.

In PR #26931, the code was refactored to use useEffect instead of useMemo for side effects (as recommended by Cubic AI review), but the import statement was never updated to include useEffect. This caused a runtime error (useEffect is not defined) when the component tried to render.

Updates since last revision

Fixed TypeScript type errors in edit-availability-hours.tsx and edit-availability-hours.ios.tsx:

  • The useScheduleById hook returns Schedule | undefined, but the component prop expected Schedule | null
  • Added nullish coalescing (schedule ?? null) to convert undefined to null

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. N/A - import and type fixes only.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?

  1. Open the companion app (iOS or Android)
  2. Navigate to Availability settings
  3. Tap on any availability schedule to open the detail page
  4. Expected: The page should load without crashing

Previously, the app would crash immediately when trying to open the availability detail page.

Checklist

  • My code follows the style guidelines of this project
  • I have checked if my changes generate no new warnings

Human Review Checklist

  • Verify useEffect is correctly added to the React import in both AvailabilityDetailScreen files
  • Verify the nullish coalescing (schedule ?? null) doesn't change runtime behavior (converts undefined to null for type safety)

Link to Devin run: https://app.devin.ai/sessions/292e159b683c42649f7286a32539d188
Requested by: Dhairyashil Shinde (@dhairyashiil)

@devin-ai-integration
Copy link
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@devin-ai-integration devin-ai-integration bot changed the title fix(companion): add missing useEffect import to AvailabilityDetailScreen fix(companion): add missing useEffect import and fix type errors Jan 17, 2026
@dhairyashiil dhairyashiil marked this pull request as ready for review January 17, 2026 16:00
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Jan 17, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

@dhairyashiil dhairyashiil enabled auto-merge (squash) January 17, 2026 16:03
@dhairyashiil dhairyashiil merged commit dccc69e into main Jan 17, 2026
46 checks passed
@dhairyashiil dhairyashiil deleted the fix/companion-useeffect-import-1768664456 branch January 17, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community Created by Linear-GitHub Sync size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants