fix(lambda): return correct number of migrated links from lambda functions #1882
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently, the lambda functions to migrate links between users always returns the number of rows affected as 1, regardless of the actual number of links transferred.
Closes #1806
Solution
migrate_user_links
has been updated to return the actual number of rows affected when updating theurls
tablemigrate_url_to_user
, it might not be necessary to return the number of rows affected, because if not for an error, there should always be exactly 1 link transferred. Is it ok to just remove this then?Tests
migrate_user_links
on stagingmigrate_url_to_user
on stagingI've tested this locally by running the javascript code on node (without using aws lambda, which I'm not sure how to use yet), and locally it seems to work wellEDIT: have tested invoking the lambda functions both locally and on staging with the help of @yong-jie and it looks good