ToolJet / ToolJet/ToolJet

frontend: App.jsx setInterval for metadata refresh never cleared - accumulates on remount, continues after logout

Open Beginner friendly
#17,498 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
40.9k
Forks
5.4k
Avg merge
2d 18h
Merged PRs (30d)
202

Description

Bug Description

App.jsx starts a setInterval for metadata refresh but never stores the return value and never clears it. If the component is unmounted and remounted, a new interval is added each time without cancelling the previous one. Stale intervals continue making authenticated HTTP requests after the user logs out.

Affected file

rontend/src/App/App.jsx, line 133:

js setInterval(this.fetchMetadata, 1000 * 60 * 60 * 1); // return value discarded - interval can never be cleared

For contrast, ViewerApp.jsx line 112 correctly stores and clears the interval:
js // ViewerApp.jsx - correct pattern this._metadataInterval = setInterval(this.fetchMetadata, interval); // componentWillUnmount: clearInterval(this._metadataInterval);

Failure scenario

  1. User logs in. App mounts. Interval 1 starts, making metadata requests every hour.
  2. HMR reload in development (or future routing change) unmounts and remounts App. Interval 2 starts.
  3. Interval 1 is still running - now two concurrent hourly requests fire.
  4. Over repeated HMR cycles, N intervals accumulate.
  5. User logs out. Stale intervals continue calling etchMetadata, triggering 401 responses and unnecessary network activity for the session lifetime.

Fix

`js
componentDidMount() {
this._metadataInterval = setInterval(this.fetchMetadata, 1000 * 60 * 60 * 1);
// ... rest of componentDidMount
}

componentWillUnmount() {
clearInterval(this._metadataInterval);
}
`

Environment

ToolJet main branch (2026-08-13), React (class component).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in frontend/src/App/App.jsx at componentDidMount and the metadata-refresh setInterval around line 133. Compare its lifecycle handling with the working pattern in ViewerApp.jsx around line 112. Done means the interval is retained and cleared when App unmounts, preventing accumulated refreshes and requests after logout.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
90/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.