Skip to content

[Code scan] Refresh input views after installed templates finish loading #562

Description

@njzjz

This issue was found during a Codex global code scan of the repository.

Baseline commit: e3c5b38

Problem

In Python mode, installed templates are fetched asynchronously. When the fetch resolves, the app updates navigation only. The /input table and /input/:id detail view use one-time snapshots and do not reload after installed_templates changes.

Code references:

dpgui/src/App.vue

Lines 108 to 114 in e3c5b38

if (process.env.VUE_APP_DPGUI_PYTHON === "1") {
fetch("/api/inputs", { method: "GET" })
.then((response) => response.json())
.then((data) => {
this.installed_templates = data;
this.update_navi();
});

items: this.all_items(),

const bb = (this.$storage.getStorageSync("CustomTemplate") || {})[id];
if (bb) {
Object.assign(prop, { jdata: bb.obj });
} else {
const cc = (this.$root.$app.installed_templates || {})[id];
if (cc) {
Object.assign(prop, { jdata: cc.obj });
}

Relevant snippet:

this.installed_templates = data;
this.update_navi();
items: this.all_items(),

Impact

If a user opens /input or a direct installed-template URL before /api/inputs completes, the table can remain stale or the detail page can show Invalid ID! even though the template becomes available shortly afterward.

Suggested fix

Make installed templates reactive for the views: use computed items, watch the app-level installed_templates, or delay route rendering until the initial template fetch has completed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions