Skip to content

Conversation

@hlbmtc
Copy link
Contributor

@hlbmtc hlbmtc commented Sep 27, 2024

A backward compatibility workaround. Initially, all group question links were generated as /questions/<child_question_id>, which redirected to /questions/<post_id>/?sub-question=<child_question_id>. Now that posts and questions are differentiated, these redirects are no longer supported.

This workaround tracks the last known legacy question ID. If a 404 lookup contains an ID lower than the last legacy question ID, we assume it may refer to a child question in a group. If so, we attempt to replace its ID with the original post_id when possible.

This works because our post ids were migrated from question ids and these 2 models do not have ids collision upon the release date, that's why we need LAST_LEGACY_QUESTION_ID

closes #662

…ckward-compatibility' into feat/662-question-group-links-backward-compatibility
@hlbmtc hlbmtc merged commit 6807ab6 into main Sep 27, 2024
@hlbmtc hlbmtc deleted the feat/662-question-group-links-backward-compatibility branch September 27, 2024 17:22
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.

Question group links backward compatibility

2 participants