Skip to content

Fixed OSD page not loading#2424

Merged
sensei-hacker merged 1 commit intomasterfrom
MrD_Fix-OSD-page-not-loading
Nov 8, 2025
Merged

Fixed OSD page not loading#2424
sensei-hacker merged 1 commit intomasterfrom
MrD_Fix-OSD-page-not-loading

Conversation

@MrD-RC
Copy link
Member

@MrD-RC MrD-RC commented Nov 8, 2025

PR Type

Bug fix


Description

  • Reordered function calls to fix OSD page loading

  • Moved updatePilotAndCraftNames() after GUI.content_ready()


Diagram Walkthrough

flowchart LR
  A["loadOsdCustomElements"] --> B["GUI.content_ready"]
  B --> C["updatePilotAndCraftNames"]
Loading

File Walkthrough

Relevant files
Bug fix
osd.js
Reorder initialization function calls for proper loading 

tabs/osd.js

  • Moved updatePilotAndCraftNames() call to execute after
    GUI.content_ready(callback) instead of before
  • This ensures the GUI is ready before updating pilot and craft names
+1/-1     

@MrD-RC MrD-RC added this to the 9.0 milestone Nov 8, 2025
@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Nov 8, 2025

PR Compliance Guide 🔍

(Compliance updated until commit 5c579cc)

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
Missing Auditing: The added call to updatePilotAndCraftNames() (line 3740) introduces a user-facing update
without any accompanying audit logging, and it is unclear whether this action is logged
elsewhere.

Referred Code
    updatePilotAndCraftNames();
}));
Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Unhandled Errors: The new sequencing adds updatePilotAndCraftNames() after GUI.content_ready(callback)
without visible error handling if the update fails or required data is absent.

Referred Code
    GUI.content_ready(callback);
    updatePilotAndCraftNames();
}));
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

Previous compliance checks

Compliance check up to commit 5c579cc
Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
No audit logs: The added call to updatePilotAndCraftNames() appears to change user-visible names without
any added auditing or logging to track this potentially sensitive action.

Referred Code
    updatePilotAndCraftNames();
}));
Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Missing error handling: The new invocation of updatePilotAndCraftNames() lacks local error handling or fallback
behavior if the function fails or required data is unavailable.

Referred Code
    updatePilotAndCraftNames();
}));
Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
Input assumptions: Calling updatePilotAndCraftNames() may consume external/user-provided names, but the new
code adds no validation or sanitization at this call site.

Referred Code
    updatePilotAndCraftNames();
}));

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Await asynchronous operation to prevent race conditions

To prevent a race condition, wrap the asynchronous
mspHelper.loadOsdCustomElements call in a promise and await its completion
before proceeding with subsequent UI updates.

tabs/osd.js [3735-3740]

 if(semver.gte(FC.CONFIG.flightControllerVersion, '7.1.0')) {
-    mspHelper.loadOsdCustomElements(createCustomElements);
+    await new Promise(resolve => mspHelper.loadOsdCustomElements((...args) => {
+        createCustomElements(...args);
+        resolve();
+    }));
 }
 
 GUI.content_ready(callback);
 updatePilotAndCraftNames();

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: The suggestion correctly identifies a potential race condition where UI readiness is signaled before an asynchronous operation completes, and proposes a valid solution to ensure proper execution order.

Medium
  • More

@sensei-hacker sensei-hacker merged commit 13817fe into master Nov 8, 2025
6 checks passed
@MrD-RC MrD-RC deleted the MrD_Fix-OSD-page-not-loading branch November 9, 2025 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants