Repository navigation
docs: fix JSDoc descriptions copied from other methods - #592
Merged
Merged
Conversation
- reboot(): described root(). Describe the reboot and use @returns. - getFeatures() documented a flags parameter it doesn't take; it belongs to getPackages(), whose own @PARAM was a TODO and whose @returns described features instead of package names. - listReverses() said it lists forwarded connections. - startService() called its options the activity configuration. - screencap() pointed at the 2.x framebuffer(serial, 'png') signature. Thanks to @ttmx for spotting the reboot() one in #545. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Karol Wrótniak <karol.wrotniak@droidsonroids.pl>
- StartServiceOptions.user said "not set by default", which is true for startActivity() only: startService() defaults it to 0, as the README says. - The README had the getFeatures()/getPackages() flags mix-up and the listReverses() "forwarded connections" line too, and the 2.x framebuffer(serial, 'png') signature under screencap(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Karol Wrótniak <karol.wrotniak@droidsonroids.pl>
When the device rejected --user, startService() cleared the option to undefined and called itself, which put --user 0 straight back, so it retried forever. Clear it to null, which the default leaves alone, and allow null in StartServiceOptions.user. Also from review: say that reboot() resolves when adbd closes the connection, that getPackages() flags go to the device shell unescaped, name the listReverses() callback value reverses, and point at device.* for the DeviceClient methods the docs called client.*. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Karol Wrótniak <karol.wrotniak@droidsonroids.pl>
This was referenced Nov 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #545
Thanks @ttmx for spotting that the JSDoc on
DeviceClient.reboot()describedroot(). This PR fixes that one and others of the same kind (a description copied from another method, a wrong parameter, a stale signature) that turned up when I compared the public JSDoc insrc/with the README API sections.reboot()device.reboot([target])section: it reboots, optionally into a target mode, and resolves when adbd closes the connection as the device goes down, not once the device is back.@return trueis now@returns true, like the neighbouringremount(),clear(),usb()andforward().@param targettext is unchanged.Other mismatches fixed
getFeatures()JSDocflagsparameter (pm list packagesfilters). The method takes no arguments; the doc belongs togetPackages().getPackages(flags)JSDoc@param flags TODO, and@returnsdescribed device features.@returns An array of package names.listReverses()JSDoclistForwards().startService()JSDoc@param options The activity configuration., copied fromstartActivity().screencap()JSDocclient.framebuffer(serial, 'png'), the 2.x signature.DeviceClient.framebuffer()takes only the format.client.framebuffer('png').StartServiceOptions.userstartActivity(), which shares the interface, butstartService()defaults it to0(code and README).device.getFeatures()/device.getPackages()device.getPackages([flags]).device.listReverses()device.screencap()framebuffer(serial, 'png').framebuffer('png').Left alone on purpose
@returnvs@returnsonroot()andscreencap()meta.:" inframebuffer()'s@returnscallback(err, …)bullets for methods that no longer take callbacks. That's a README-wide cleanup and out of scope here. The JSDoc doesn't mention callbacks except where they are still supported (util.readAll,sync.stat, …).client.ts,sync.tsand the transfers have no JSDoc on their public methods, so there was nothing to compare there.Review follow-ups
startService()retried forever when the device rejected--user: the retry setoptions.usertoundefined, and the default put--user 0straight back. It now setsnull, which the default leaves alone, andStartServiceOptions.useracceptsnull(also documented as a way to leave--userout). This is the one code change in this PR. A new test makes the device reject--useronce and checks that the second request has no--user; with the oldundefinedit fails.reboot(): RebootCommand waits for adbd to close the connection, so the JSDoc and README now say it resolves then, not when ADB accepts the command.getPackages(flags): the docs now say the string goes to the device shell unescaped. Not escaped in code, because one string carries several flags ('-3 -f').device.*, notclient.*, for theDeviceClientmethods the docs pointed at:framebuffer()(screencap fallback),isInstalled(),push(), andstat()/push()/pull()insyncService(). The 2.x changelog line aboutclient.framebuffer()stays as history.device.listReverses(): the callback iscallback(err, reverses).npm run lint,npm run compileandnpm testpass.🤖 Generated with Claude Code