Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Change to send Analytics Data to HealthData Server also#14282

Open
niteskum wants to merge 5 commits intoadobe:masterfrom
niteskum:AnalyticsDataBugFixes
Open

Change to send Analytics Data to HealthData Server also#14282
niteskum wants to merge 5 commits intoadobe:masterfrom
niteskum:AnalyticsDataBugFixes

Conversation

@niteskum
Copy link
Copy Markdown
Collaborator

This PR includes changes for sending Analytics Data to HealthData Server.

@niteskum
Copy link
Copy Markdown
Collaborator Author

ping @swmitra @navch @vickramdhawal for review

}
};

var handleFail = function handleFail() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably you wrote this syntax by mistake. This is useful when we are running in IE or when we want to assign a small function name to use inside the function.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's not a good idea to write nested function if you function executed multiple time.

if(sendFailed) {
PreferencesManager.setViewState(Eventparams.eventName, 0, options);
} else {
sendFailed = true;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What is the use of this sendFailed? Looks like it will always execute else part.

.always(function () {
sendAnalyticsDataToServer(Eventparams, url)
.done(function () {
result.resolve();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just make sure view state is correct in every case like not able to send health data server but successfully sent on analytics server.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

View State is unset only if it fails to send Data to both the server. If it fails for any of one server then it will execute else part and sendFailed is assigned to true. when it will fail for second server also It will go in if part and will unset the view state.

@niteskum niteskum changed the title [WIP] Change to send Analytics Data to HealthData Server also Change to send Analytics Data to HealthData Server also May 2, 2018
@vickramdhawal
Copy link
Copy Markdown
Collaborator

@niteskum I'm not sure i understand the purpose of this PR. If the user is offline even posting to health data url will fail. Should we not have simply passed on the data to the HealthLogger which would have guaranteed eventual persistence with the health data.

@abose
Copy link
Copy Markdown
Contributor

abose commented Jun 2, 2018

What is the intent of this change?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants