[ma-ram-monitor@lanote] Update to v1.0.7: Async refactor#8289
[ma-ram-monitor@lanote] Update to v1.0.7: Async refactor#8289notoyeah wants to merge 2 commits intolinuxmint:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the Cinnamon “Moderately Advanced RAM Monitor” applet to fetch /proc/meminfo asynchronously, aiming to reduce UI blocking during periodic updates, and updates related metadata/translations for the v1.0.7 release.
Changes:
- Refactored the applet UI/rendering to use an explicit
St.Labeland async/proc/meminforeads (load_contents_async+async/await). - Updated versioning/metadata to v1.0.7 and refreshed translation template + PO references.
- Minor styling and README updates to reflect the new async implementation.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ma-ram-monitor@lanote/info.json | Bumps applet version to 1.0.7. |
| ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/metadata.json | Bumps version to 1.0.7 and updates author field. |
| ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/applet.js | Async refactor for /proc/meminfo reads; UI label/container rework; loop and cleanup updates. |
| ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/stylesheet.css | Adjusts warning blink styling (removes radius/transition). |
| ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/po/ma-ram-monitor@lanote.pot | Updates POT metadata and source references. |
| ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/po/pl.po | Updates POT creation date and source references. |
| ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/po/fr.po | Updates bug URL formatting, POT creation date, and wraps long strings. |
| ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/po/es.po | Updates POT creation date and source references. |
| ma-ram-monitor@lanote/README.md | Updates feature list to describe async engine and other capabilities. |
Comments suppressed due to low confidence (5)
ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/po/fr.po:11
- The PO header still declares Project-Id-Version 1.0.0 while this PR bumps the applet to 1.0.7 (and the POT was updated). Update the Project-Id-Version in this PO header as well to keep translation metadata consistent.
msgid ""
msgstr ""
"Project-Id-Version: ma-ram-monitor@lanote 1.0.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2026-02-07 17:42+0100\n"
"PO-Revision-Date: 2026-02-04 10:07+0100\n"
ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/po/es.po:12
- The PO header still declares Project-Id-Version 1.0.0 while this PR bumps the applet to 1.0.7 (and the POT was updated). Update the Project-Id-Version in this PO header as well to keep translation metadata consistent.
msgid ""
msgstr ""
"Project-Id-Version: ma-ram-monitor@lanote 1.0.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2026-02-07 17:42+0100\n"
"PO-Revision-Date: \n"
ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/po/ma-ram-monitor@lanote.pot:4
- The POT header changes the copyright year from 2016 to 2026. Unless the intent is to replace the original year, consider using a range (e.g., 2016–2026) or keeping the original year to avoid losing the original attribution context.
# MODERATELY ADVANCED RAM MONITOR
# This file is put in the public domain.
# notoyeah, 2026
#
ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/applet.js:100
- _update_loop() calls the async _update_ui() without awaiting it, so if file I/O ever takes longer than the refresh interval (or settings changes trigger extra updates), multiple overlapping updates can be in-flight at once and complete out of order. Consider ensuring only one update runs at a time (e.g., await _update_ui() before scheduling the next timeout, or keep an in-flight flag/promise and skip if one is running).
_update_loop() {
this._update_ui();
let interval = parseFloat(this.frequency) * 1000;
this._timeoutId = Mainloop.timeout_add(interval, () => {
this._update_loop();
return false;
});
}
ma-ram-monitor@lanote/files/ma-ram-monitor@lanote/po/pl.po:13
- The PO header still declares Project-Id-Version 1.0.0 while this PR bumps the applet to 1.0.7 (and the POT was updated). Update the Project-Id-Version in this PO header as well to keep translation metadata consistent.
msgstr ""
"Project-Id-Version: ma-ram-monitor@lanote 1.0.0\n"
"Report-Msgid-Bugs-To: https://github.com/linuxmint/cinnamon-spices-applets/"
"issues\n"
"POT-Creation-Date: 2026-02-07 17:42+0100\n"
"PO-Revision-Date: 2026-02-01 17:50+0100\n"
| // Return only if we have both values and they are valid numbers | ||
| return (memInfo.total > 0 && memInfo.available > 0) ? memInfo : null; |
There was a problem hiding this comment.
_getMemInfoAsync() returns null unless MemAvailable is > 0. When MemAvailable legitimately reaches 0 under extreme memory pressure, the applet will incorrectly show “RAM error”. Treat 0 as a valid value (e.g., check for null/NaN instead, and allow available >= 0).
| // Return only if we have both values and they are valid numbers | |
| return (memInfo.total > 0 && memInfo.available > 0) ? memInfo : null; | |
| // Return only if we have both values and they are valid numbers. | |
| // Treat 0 as a valid value for MemAvailable (extreme memory pressure). | |
| const hasValidTotal = Number.isFinite(memInfo.total) && memInfo.total > 0; | |
| const hasValidAvailable = Number.isFinite(memInfo.available) && memInfo.available >= 0; | |
| return (hasValidTotal && hasValidAvailable) ? memInfo : null; |
There was a problem hiding this comment.
I am working on a new version of my applet in which the above errors will be fixed.
Summary
Complete refactor of the RAM monitor to improve performance and system stability.
Changes
load_contents_async) to prevent UI freezes./proc/meminfoparsing.Tested on Cinnamon 6.6.6 - works stable and non-blocking.