Skip to content

Fix: LTI URL generation fails silently with missing fields#28

Open
ImranFarhat01 wants to merge 1 commit into
FOSSEE:developfrom
ImranFarhat01:fix/lti-validation-clean
Open

Fix: LTI URL generation fails silently with missing fields#28
ImranFarhat01 wants to merge 1 commit into
FOSSEE:developfrom
ImranFarhat01:fix/lti-validation-clean

Conversation

@ImranFarhat01

Copy link
Copy Markdown

Problem

Clicking the LTI URL generation button with empty fields did nothing
visible to the user.

Root Cause

The handler accessed the selected schematic's id even when no
schematic was selected, causing a silent failure (an unhandled error
appeared only in the browser console, with no feedback shown on screen).

Fix

  • Added a check for a missing consumer key or secret key
  • Added a check for a missing or incomplete schematic selection
  • Both show a clear error message using the existing error display
    already present in the component

Testing

  • Clicking the generate button with all fields empty now shows
    "Consumer Key and Secret Key are required."
  • Filling in keys but leaving the schematic unselected shows
    "Please select a schematic before generating LTI URL."
  • Filling in all fields correctly still generates the LTI URL as expected

Clicking the LTI URL generation button with empty fields did nothing
visible. handleLTIGenerate accessed ltiDetails.modelSchematic.id even
when modelSchematic was unset, causing a silent failure (an
unhandled error in the console, no feedback on screen).

Fix:
- Added a check for missing consumer key or secret key
- Added a check for a missing/incomplete schematic selection
- Both show a clear error message via the existing consumerError
  display

Testing:
- Clicking the generate button with all fields empty now shows
  'Consumer Key and Secret Key are required.'
- Filling in keys but leaving the schematic unselected shows
  'Please select a schematic before generating LTI URL.'
- Filling in all fields correctly still generates the LTI URL as
  expected
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.

1 participant