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

Log the contained level id as the attempted level id #15321

Merged
merged 3 commits into from May 24, 2017

Conversation

balderdash
Copy link
Contributor

Milestone posts from contained level completions use the level id of the contained level. At the moment, the api_controller is still logging the attempts under the level id of the outer level, rather than contained level. This mismatch is giving us a bunch of spurious activitymonitor complaints.

This PR updates the logging of the level attempt to use the contained level id as well (when present). Logentry logs are only consumed by activitymonitor, so this shouldn't mess with anything else.

@@ -204,7 +204,7 @@ def user_progress_for_stage
slog(
tag: 'activity_start',
script_level_id: script_level.try(:id),
level_id: level.id,
level_id: level.contained_levels.empty? ? level.id : level.contained_levels.first.id,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason we are logging only the first contained level, rather than logging all of them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't actually render more than one contained level anywhere. There's one level that has multiple contained levels, but it only shows the first and isn't actually used in a script: https://levelbuilder-studio.code.org/levels/4562

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then why do we store it as an array?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing there was a plan to one day support multiple, but nobody got around to that.

@balderdash balderdash merged commit ae48b91 into staging May 24, 2017
@balderdash balderdash deleted the activity-monitor-contained branch May 26, 2017 22:39
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.

None yet

3 participants