Fix Modified timestamp in commands.js
Fixes #1263
Description
The "Modified" field in Recent Commands was incorrectly using response.created, which caused it to display the creation timestamp instead of the last modification time.
This PR updates the implementation to use response.modified, ensuring consistency with the API response and WebSocket handler.
Changes
- Replaced
response.createdwithresponse.modifiedin commands.js
Testing
- Set up OpenWISP locally
- Reproduced the issue where "Modified" showed incorrect timestamp
- Applied the fix
- Verified that the Modified field now shows correct updated timestamp
Impact
- Fixes incorrect UI behavior
- Aligns frontend with backend data
This PR advances the openwisp-controller submodule pointer and applies two small fixes: (1) AbstractVpnClient._get_common_name no longer mutates the device's ๐ฏ 2 (Simple) | โฑ๏ธ ~10 minutes๐ Walkthrough
Walkthrough
name when truncating it (uses a local name variable and passes it into the CN formatting), and (2) the Recent Commands UI now uses response.modified for the "Modified" field instead of response.created.Estimated code review effort
Possibly related issues
#1263: Fixes the Recent Commands row using created for the "Modified" field โ this PR changes the UI to use response.modified.#1284: Related to AbstractVpnClient._get_common_name mutating device name โ this PR prevents mutation by using a local truncated name.
[!CAUTION]
Pre-merge checks failed
Please resolve all errors before merging. Addressing warnings is optional.
- [ ] Ignore
โ Failed checks (1 error, 1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Out of Scope Changes check | โ Error | The PR contains changes to openwisp-controller submodule and vpn.py that are unrelated to the primary objective of fixing the Modified timestamp in commands.js. | Remove unrelated changes (submodule commit and vpn.py mutation fix) or clarify their relationship to issue #1263 in the description. |
| Title check | โ ๏ธ Warning | The title lacks the required type prefix (e.g., [fix], [change]). It should follow the format '[type] Descriptive title'. | Update the title to '[fix] Modified timestamp in commands.js' to comply with the required format. |
โ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description check | โ Passed | The description is comprehensive and mostly follows the template, covering reference to issue #1263, clear description of changes, testing performed, and impact assessment. |
| Linked Issues check | โ Passed | The PR successfully addresses issue #1263 by replacing response.created with response.modified in commands.js to fix the Modified timestamp display in Recent Commands. |
| Bug Fixes | โ Passed | One-line fix replaces response.created with response.modified for Modified field, directly addressing bug #1263 root cause. |
โจ Finishing Touches
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Commit Message Format Failure
Hello @k-sumayya, (Analysis for commit c40911a)
The commit message is not in the correct format. The issue number referenced in the title must also be included in the body.
Example of correct format:
[fix] Fix incorrect Modified timestamp in Recent Commands #1263
This commit addresses an issue where the Modified timestamp was not being
updated correctly for recent commands.
Fixes #1263
coverage: 98.658%. remained the same when pulling 4dc5fc141c6217f49d0a51125e0043b1fb961632 on k-sumayya:fix-modified-timestamp into d4d013f39eafc701089f287785c3aed81c07f7bd on openwisp:master.
Closing this due to inactivity.
This PR is superseded by https://github.com/openwisp/openwisp-controller/pull/1305