Fourth pass on the mbweb web console. Snap 20260429-1009 analysed
and cleaned. Bugs, dead code, remaining French strings, and the last
open improvement items from the backlog.
The βTotalβ card on /users was displaying users.length (number
of rows on the current page, max 50) instead of total (the global
count from the DB). Fixed to use total.
/api/dashboard missing try/catchThe dashboard API endpoint was the only API route without error
handling. A getDashboardData failure would propagate as an
unhandled rejection and return HTML instead of JSON. Wrapped in
try/catch consistent with all other API routes.
<div> parasite in /channels table sectionAn empty <div></div> was inserted between the pagination bar and
the channel table, producing unexpected whitespace in the layout.
Removed.
Five strings were still in French across four route files:
routes/api.js β three inline commentsroutes/home.js β section title and subtitle in quickActionsroutes/profile.js β stat card label in accessible channelsroutes/quotes.js β stat card label for channels with quotesroutes/commands.js β count badge labelAll translated to English. Zero French strings remaining in the codebase.
routes/home.jsAfter the app.js split, home.js retained the full import block
from the original monolith: 15 functions from mediabotRepository,
of which 0 were actually called in that file. home.js delegates
all data fetching to getDashboardData and never touches the
repository directly. The entire import block was removed.
/channelsMaster and above can now filter the channel list by name,
description or topic via a ?q= search bar. The filter is applied
server-side via a LIKE query in getAllChannels. Pagination
preserves the active search term between pages. Non-Master users
are not shown the filter bar (they already see only their own
channels; free-text search adds no value there).
/api/channels also accepts ?q= and returns search in the
JSON response.
getUserChannels in dashboardData.jsgetDashboardData called getUserChannels on every home page load.
On authenticated pages, requireLogin can also trigger
refreshSessionUser which calls getUserChannels for the same
user within the same request window.
A 30-second in-memory cache keyed by id_user was added in
dashboardData.js. If the home page is loaded within 30 seconds
of any other authenticated page load, the DB is not hit a second
time. Expired entries are evicted lazily to prevent unbounded
growth.
All pagination and filter bar CSS classes introduced in previous
rounds (.mbw-pagination, .mbw-page-btn, .mbw-filter-bar,
.mbw-search-input, .mbw-select) were confirmed present in
public/css/mbweb.css with correct definitions including
hover and disabled states.
| # | Item | Status |
|---|---|---|
| B1 | Users stat card users.length β total |
β fixed |
| B2 | /api/dashboard missing try/catch |
β fixed |
| B3 | Empty <div> in channels table |
β fixed |
| i18n | Last French strings (5) | β done |
| R1 | 15 dead imports in home.js |
β removed |
| A1 | CSS classes verified | β ok |
| A2 | Search/filter on /channels |
β done |
| A3 | Cache getUserChannels in dashboardData |
β done |
No open items remaining from the audit backlog. Long-term: EJS migration (R12), Matrix/Discord stubs.
You must be logged in to reply.