Skip to content

Conversation

JongtaekChoi
Copy link
Contributor

@JongtaekChoi JongtaekChoi commented Jul 21, 2025

PR Title

�� Type of change:

  • ✨Feature/chore
  • ♻️ Refactor
  • 🔧 Bugfixes

✏️ Description:

This PR added setup completion tracking to prevent multiple calls to the LINE SDK setup function. Fixes #186

Problem: The LINE SDK setup function could be called multiple times, causing app crashes or unexpected behavior due to internal SDK errors that developers couldn't properly handle.

Solution: Modified the setup method to check the existing LoginManager.shared.isSetupFinished property and reject with a clear error message when setup is already completed. This allows developers to handle the situation properly in the JavaScript layer instead of experiencing app crashes.

Key Changes:

  • Added early return with reject("SETUP_ALREADY_COMPLETED", "Setup has already been completed", nil) when setup is already finished

Acceptance criteria:

  • Setup method rejects with clear error when already completed
  • JavaScript layer can properly handle the error
  • App crashes prevented when setup is called multiple times
  • Existing functionality remains unchanged for first-time setup calls

🎥 Screen record:

N/A - This is a backend fix that doesn't require UI changes.


📌 Notes:

  • This change only affects the iOS implementation
  • Uses existing LINE SDK property isSetupFinished instead of adding new variables
  • No environment variables or configuration changes required
  • Breaking change: Apps that don't handle the new error will need to add error handling

✔️Tasks:

  • Modify setup method to check LoginManager.shared.isSetupFinished
  • Implement reject logic instead of resolve for already completed setup
  • Ensure proper error handling in JavaScript layer
  • Test setup flow to verify error handling works correctly

⚠️ Warnings:

  • Breaking Change: Apps that don't handle the SETUP_ALREADY_COMPLETED error will need to add try-catch blocks
  • This fix is specific to iOS implementation only
  • Android implementation may need similar changes if the same issue exists
  • Relies on LINE SDK's internal setup tracking mechanism
  • Developers should handle the error gracefully in their setup calls

@Joaguirrem Joaguirrem changed the title feat: add setup completion tracking to prevent multiple setup calls [Feat] Add setup completion tracking to prevent multiple setup calls Jul 21, 2025
@Joaguirrem Joaguirrem merged commit 1683841 into xmartlabs:main Jul 21, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App crashes because of calling Line.setup more than once
2 participants