Skip to content

[ma-ram-monitor@lanote] Update to v1.0.7: Async refactor#8289

Open
notoyeah wants to merge 2 commits intolinuxmint:masterfrom
notoyeah:master
Open

[ma-ram-monitor@lanote] Update to v1.0.7: Async refactor#8289
notoyeah wants to merge 2 commits intolinuxmint:masterfrom
notoyeah:master

Conversation

@notoyeah
Copy link
Copy Markdown
Contributor

@notoyeah notoyeah commented Feb 7, 2026

Summary

Complete refactor of the RAM monitor to improve performance and system stability.

Changes

  • Implemented asynchronous file reading (load_contents_async) to prevent UI freezes.
  • Optimized /proc/meminfo parsing.

Tested on Cinnamon 6.6.6 - works stable and non-blocking.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.Label and async /proc/meminfo reads (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"

Comment on lines +275 to +276
// Return only if we have both values and they are valid numbers
return (memInfo.total > 0 && memInfo.available > 0) ? memInfo : null;
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_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).

Suggested change
// 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;

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

@notoyeah notoyeah Feb 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am working on a new version of my applet in which the above errors will be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants