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

AFE: move submit logging to server #35723

Merged
merged 6 commits into from Jul 9, 2020
Merged

AFE: move submit logging to server #35723

merged 6 commits into from Jul 9, 2020

Conversation

bencodeorg
Copy link
Contributor

  1. Moves submit logging to server, which allows us to log whether the account was newly created or not.
  2. Moves page navigation into callbacks on logging events, such that we won't navigate until the event has finished.

Testing Story

Tested manually. I did have some issues where my amazon_future_engineer_submit request would hang (and, as a result, the "Please wait..." message would show forever and the network request continued indefinitely), but I think that was a result of syntax errors I had in the controller logging action. Did not see that issue in several runs through the flow subsequently. But, keep an eye out when reviewing for anything that looks suspect.

Reviewer Checklist:

  • Tests provide adequate coverage
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@bencodeorg bencodeorg requested review from islemaster and a team July 8, 2020 23:17
@@ -43,13 +58,13 @@ export default class AmazonFutureEngineerAccountConfirmation extends React.Compo
if you already have one.
</div>
<div style={styles.body}>
Already have a Code.org account? <a href={SIGN_IN_URL}>Sign in.</a>
Already have a Code.org account?{' '}
<a onClick={this.signInButtonPress}>Sign in.</a>
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing the href may have changed the style of this link. I think, in this case, you could avoid that with href="#" or something - I don't feel bad about changing the hash since we're about to navigate.

Copy link
Contributor Author

@bencodeorg bencodeorg Jul 9, 2020

Choose a reason for hiding this comment

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

Nice, good to know will update! Main difference I see is that when you hover it gives you the clicky finger with an href, and the text cursor without it.

Copy link
Member

Choose a reason for hiding this comment

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

fwiw, you can use cursor: pointer to show the clicky finger again.

formData: submission_body
}.to_json
}
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Right now we're tracking this event if we successfully submit to AFE or if submitting to AFE is disabled for that environment. (But not if we skip submission or submission fails for some other reason.) That seems okay - is it the desired behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah it was sort of for testing purposes, so I could see what would be sent to Firehose in development (since it sends Firehose requests to your logfile). Seems maybe useful in the future as well, to have the entire payload returned to the controller in development (instead of just immediately returning)?

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

Please add unit tests that check whether we call firehose in the expected circumstances on the server.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

👍

@bencodeorg bencodeorg merged commit 8f9ca92 into staging Jul 9, 2020
@bencodeorg bencodeorg deleted the afe-logging-updates branch July 9, 2020 18: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.

None yet

3 participants