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

Implement new logic for /wda/deactivateApp endpoint #381

Merged
merged 7 commits into from
Mar 5, 2017

Conversation

mykola-mokhnach
Copy link
Contributor

As per appium/appium#7741

Please double check whether the flow is correct and matches to what was discussed in that thread.

if (_.isUndefined(duration)) {
// TODO: Replace the block after deprecated stuff is removed
// seconds = Number.MAX_SAFE_INTEGER;
log.warn(`commands.background: Application under test will never be restored in the future if no duration is provided.\n
Copy link
Contributor

Choose a reason for hiding this comment

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

A template that spans two lines will keep the formatting. So this will have two newlines in it. Also, it will get printed weirdly in our logs, since the prefix will be skipped. I'd rather see this on a single line.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also this message is a bit confusing. It makes it seem like the application will not be restored, not that the behavior will change at some point in time.

Copy link
Member

Choose a reason for hiding this comment

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

yeah, one single line or two log.warn calls, one per line

Copy link
Contributor

Choose a reason for hiding this comment

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

Also also the commands.background part seems geared toward developers of Appium, whereas it is really for end users.

Copy link
Member

@jlipps jlipps left a comment

Choose a reason for hiding this comment

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

yes, just the comment about log formatting but the logic looks sound

if (_.isUndefined(duration)) {
// TODO: Replace the block after deprecated stuff is removed
// seconds = Number.MAX_SAFE_INTEGER;
log.warn(`commands.background: Application under test will never be restored in the future if no duration is provided.\n
Copy link
Member

Choose a reason for hiding this comment

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

yeah, one single line or two log.warn calls, one per line

Copy link
Contributor

@imurchie imurchie left a comment

Choose a reason for hiding this comment

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

I guess I'm confused. I thought the point of the original issue was to give access to /wda/homescreen?

if (_.isUndefined(duration)) {
// TODO: Replace the block after deprecated stuff is removed
// seconds = Number.MAX_SAFE_INTEGER;
log.warn(`commands.background: Application under test will never be restored in the future if no duration is provided.\n
Copy link
Contributor

Choose a reason for hiding this comment

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

Also this message is a bit confusing. It makes it seem like the application will not be restored, not that the behavior will change at some point in time.

if (_.isUndefined(duration)) {
// TODO: Replace the block after deprecated stuff is removed
// seconds = Number.MAX_SAFE_INTEGER;
log.warn(`commands.background: Application under test will never be restored in the future if no duration is provided.\n
Copy link
Contributor

Choose a reason for hiding this comment

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

Also also the commands.background part seems geared toward developers of Appium, whereas it is really for end users.

if (duration >= 0) {
seconds = duration;
} else {
seconds = Number.MAX_SAFE_INTEGER;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why?

@mykola-mokhnach
Copy link
Contributor Author

I guess I'm confused. I thought the point of the original issue was to give access to /wda/homescreen

Yep, I've almost forgotten about one important thing. Fixed now. Friday...

// seconds = Number.MAX_SAFE_INTEGER;
log.warn('commands.background: Application under test will never be restored in the future if no duration is provided. ' +
'See https://github.com/appium/appium/issues/7741');
seconds = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel uncomfortable with all the over-determination of seconds here. I'd rather use this logic to build up the endpoint and params, and then act on that below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree. Changed the logic

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.

3 participants