Fix silent data loss when platform defaults to reddit for Twitter-only simulations#151
Open
karesansui-u wants to merge 1 commit into666ghj:mainfrom
Open
Conversation
…y simulations The API retrieval layer hardcoded reddit as the default platform in 11+ locations. When a Twitter-only simulation was run, all data retrieval APIs silently returned empty results because they looked for reddit_simulation.db which did not exist. This commit reads the simulation enable_twitter/enable_reddit config to determine the correct default platform. Fixes 666ghj#150
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
/profiles,/profiles/realtime,/posts,/comments) hardcoded'reddit'as the default platformenable_reddit=false), these APIs silently returned empty results because they looked forreddit_simulation.db/reddit_profiles.jsonwhich did not exist'reddit'in Vue components and API wrapper functionsChanges
Backend (
simulation.py,simulation_manager.py):SimulationState.get_default_platform()that readsenable_twitter/enable_redditconfig_get_default_platform()helper in the API layer (follows existing_check_simulation_preparedpattern)'reddit'defaults in 4 endpoints with config-aware defaultsplatformparameter to/commentsendpoint (was hardcoded toreddit_simulation.db)Frontend (
simulation.js,Step2EnvSetup.vue,Step5Interaction.vue):'reddit'defaults from 3 API functions; omit platform param to let backend decide'reddit'from 2 Vue component callsScope: This PR fixes the API retrieval layer only. The profile generation layer (
oasis_profile_generator.py) already correctly selects platform based on simulation config.Backward compatible: Explicit
platform=redditorplatform=twitterstill works as before.Test plan
enable_reddit=false) and verify profiles/posts/comments are returnedFixes #150