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

Send revision ID on save success event log #4544

Merged
merged 1 commit into from Jun 13, 2023
Merged

Conversation

mazevedofs
Copy link
Collaborator

@mazevedofs mazevedofs commented Jun 13, 2023

Phabricator: https://phabricator.wikimedia.org/T337331

Notes

  • We missed sending the revision ID on the saveSuccess() event log

Test Steps

  1. On an article, create an edit and save it. Check either on a network traffic debugger on the analytics platform that the events contain a revision_id field.

@mazevedofs mazevedofs requested review from a team and staykids and removed request for a team June 13, 2023 14:43
@@ -184,7 +184,7 @@ extension ArticleViewController: SectionEditorViewControllerDelegate {
case .success(let changes):
dismiss(animated: true)
waitForNewContentAndRefresh(changes.newRevisionID)
EditAttemptFunnel.shared.logSaveSuccess(articleURL: self.articleURL)
EditAttemptFunnel.shared.logSaveSuccess(articleURL: self.articleURL, revisionId: Int(changes.newRevisionID))
Copy link
Contributor

Choose a reason for hiding this comment

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

No change needed here, and it looks like we already use this pattern elsewhere, but just wanted to mention: generally for important casting situations where there's possible precision loss, I'll just future proof and use the higher level NSNumber and allow it to handle doing the right thing, so something like NSNumber(value: changes.newRevisionID).intValue here. But my understanding of this specific case is that we're ok without that, with Int on the devices that can run our app itself being a Int64 and it being unlikely we hit the max value revision id.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, I was unsure about that too; it's a good thing to keep in mind for a future time

Copy link
Contributor

@staykids staykids left a comment

Choose a reason for hiding this comment

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

Nice! Made a Test wiki change and confirmed via inspecting traffic that the saveSuccess action payload sent along a revision id and was a successful 201.

@staykids staykids merged commit 4b17090 into main Jun 13, 2023
2 checks passed
@staykids staykids deleted the edit_attempt-rev-id branch June 13, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants