fix(onebot): get_rkey_server fails on empty rkey set; document rename return
Adversarial Wave 2 pass (no blockers): get_rkey_server now returns
ACTION_FAILED instead of an 'expired_time=now, no keys' shell when no
download rkey is available, so a caching caller can't misread 'unavailable'
as 'valid-but-expired'. Added an empty-list test. Annotated rename_group_file's
{ok:true} body as a deliberate NapCat-parity deviation from sibling file ops.
This commit is contained in:
3 files changed
+14
No files matched your search
@@ -1230,6 +1230,12 @@ export const actions = [
|
||||
{ rkey?: string; ttl?: number } | undefined;
|
||||
const priv = pick(10);
|
||||
const group = pick(20);
|
||||
// No rkey at all → fail rather than hand back an "expired_time = now,
|
||||
// no keys" shell that a caching caller would misread as a valid-but-empty
|
||||
// (already-expired) result.
|
||||
if (!priv?.rkey && !group?.rkey) {
|
||||
return failedResponse(RETCODE.ACTION_FAILED, 'no download rkey available');
|
||||
}
|
||||
const ttls = [priv?.ttl, group?.ttl].filter((t): t is number => typeof t === 'number' && t > 0);
|
||||
const minTtl = ttls.length ? Math.min(...ttls) : 0;
|
||||
const data: JsonObject = {
|
||||
|
||||
Reference in new issue
Block a user