Repository navigation
fix(resellerclub): read the order id the API returns as a bare integer - #459
Conversation
domains/orderid.json answers with the order id as a plain integer. The
shared call() helper is typed to return an array, so the decoded integer
raised a TypeError, the catch turned it into an ERROR response and
getOrderId() returned null. Every command that looks the order up first
failed: renew ("Domain order not found"), nameserver changes, the lock
toggle and the EPP code.
call() now wraps a non-array JSON answer as ['value' => ...] and
getOrderId() reads it. getNameservers() also returned the ns1 string from
an array method; it now collects the ns1..ns13 keys into a list.
|
Merged, thank you. Verified before merging: Your tests, run on 1.29.0 before the merge: 3 of 4 red (the fourth is the guard that an unknown domain is still reported as not found). All green after. Measured on the merge result: the full suite is green — 5463 passed in parallel ( |
|
Released in 1.30.0, the stable channel, offered to every installation. Gates on the tag and that package: full suite 5463 passed in parallel plus the 17 serial installer tests (0 failed, 5 skipped); 276 translation and parity tests green; the update lab 14 scenarios ALL GREEN; the real package updated the last stable (1.29.0 → 1.30.0, 13 checks) and the last beta (1.25.1-beta.1 → 1.30.0, 14 checks), each installed from its published package in the published runtime image with the signature checked by the key built into the application; the three uploaded assets re-downloaded and compared byte for byte before publishing. |
What was wrong
Every ResellerClub command that works on an existing domain looks the order up first with
domains/orderid.json. ResellerClub documents the answer as the order id, a plain integer ("Returns the Order Id (Integer) associated with a registered domain name", KB answer 763).call()is typed to return an array, so the decoded integer raised a TypeError. The catch incall()turned it into anERRORresponse, andgetOrderId()returned null. So for every ResellerClub domain:The existing renew test passed only because its fake answered
["12345678"], an array the API does not send.Reported in the community: https://community.pnlcs.com/t/43
The change
call()wraps a non-array JSON answer as['value' => …], so the return type holds.getOrderId()reads that value. The old[0]form still works.getNameservers()returned thens1string from a method typedarray. That TypeError was not caught. It now collectsns1…ns13into a list, the same waysyncDomain()reads them.Tests
tests/Feature/ResellerClubOrderIdTest.phpfakes the documented bare integer. On main, 3 of its 4 tests fail: renew, the EPP code with nameserver save and lock, and the nameserver list. With the change, all 4 pass. Full suite: 5,430 passed; the 2 failures (CurrencyAndBackupTest, MailLinkHostTest) fail the same way on main.