-
-
Notifications
You must be signed in to change notification settings - Fork 426
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
Conversation
lib/commands/general.js
Outdated
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this 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
lib/commands/general.js
Outdated
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 |
There was a problem hiding this comment.
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
There was a problem hiding this 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
?
lib/commands/general.js
Outdated
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 |
There was a problem hiding this comment.
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.
lib/commands/general.js
Outdated
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 |
There was a problem hiding this comment.
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.
lib/commands/general.js
Outdated
if (duration >= 0) { | ||
seconds = duration; | ||
} else { | ||
seconds = Number.MAX_SAFE_INTEGER; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
Yep, I've almost forgotten about one important thing. Fixed now. Friday... |
lib/commands/general.js
Outdated
// 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree. Changed the logic
As per appium/appium#7741
Please double check whether the flow is correct and matches to what was discussed in that thread.