Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store LMS API id on LMSUser during launches #6878

Open
wants to merge 4 commits into
base: lms-user-api-id-bug
Choose a base branch
from

Conversation

marcospri
Copy link
Member

@marcospri marcospri commented Nov 28, 2024

For:

Testing

Launch a LTI1.3 assignment https://hypothesis.instructure.com/courses/319/assignments/3308

  • Check the value in the DB
 select * from lms_user where lms_api_user_id is not null;
-[ RECORD 1 ]---------------+----------------------------------------------------
id                          | 2051
tool_consumer_instance_guid | VCSy8DAKCFIQYaItpSGyXhOXIlk5A6NWduVVG1u3:canvas-lms
lti_user_id                 | 969fc294ee26e3f1d0c9714af3351dc4eacfd6df
h_userid                    | acct:[email protected]
email                       | [email protected]
display_name                | DISPLAY NAME TEACHER
created                     | 2024-11-28 14:07:58.223625
updated                     | 2024-11-29 10:51:29.29357
lti_v13_user_id             | 3f25366d-ab34-4307-be21-3ea444559e82
lms_api_user_id             | 36
select * from lms_user where lms_api_user_id is not null;
-[ RECORD 1 ]---------------+----------------------------------------------------
id                          | 2051
tool_consumer_instance_guid | VCSy8DAKCFIQYaItpSGyXhOXIlk5A6NWduVVG1u3:canvas-lms
lti_user_id                 | 969fc294ee26e3f1d0c9714af3351dc4eacfd6df
h_userid                    | acct:[email protected]
email                       | [email protected]
display_name                | DISPLAY NAME TEACHER
created                     | 2024-11-28 14:07:58.223625
updated                     | 2024-11-29 11:04:30.813082
lti_v13_user_id             | 3f25366d-ab34-4307-be21-3ea444559e82
lms_api_user_id             | 36

bulk_upsert will update the table columns in `update_elements` with the
value passed in updated.

In the case of lti_v13_user_id  that means that the value will be set on
LTI1.3  and removed (set to None) on LTI1.1 launches.

To fix this we change the value set from the raw value to
coalesce(value, LMSUser.lti_v13_user_id)
@marcospri marcospri changed the title Lms user api id code Store LMS API id on LMSUser during launches Nov 29, 2024
@marcospri marcospri marked this pull request as ready for review November 29, 2024 11:06
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.

2 participants