Skip to content

Fixed the no-JavaScript archive UI and stopped uncaught errors leaking detail - #11

Merged
vagisha merged 5 commits into
masterfrom
archive-and-sql-followups
Sep 14, 2026
Merged

vagisha merged 5 commits into
masterfrom
archive-and-sql-followups

Conversation

@vagisha

@vagisha vagisha commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • The archived list and its bulk buttons now work with JavaScript off -- a native <details> and
    buttons enabled in the HTML. With JavaScript on, the script still gates the buttons on selection.
  • A bulk archive that skips a project (won't parse or won't load) now reports it instead of reporting
    success.
  • A generic error.jsp logs an uncaught exception under a reference and shows the user only that
    reference, so the project-search SQL no longer reaches the browser.

Test plan

  • No-JavaScript archive UI, plus JavaScript-on button gating and sorting
  • Bulk archive reports skipped projects, a clean batch reports nothing
  • error.jsp shows a reference with no stack trace or SQL, detail logged server-side
  • Non-admin refused from admin actions, Add Researcher stays open

Co-Authored-By: Claude noreply@anthropic.com

vagisha and others added 4 commits September 13, 2026 14:36
…lently

ArchiveProjectsAction.execute skipped a projectIds value that would not parse or would not load,
logged a warning and carried on, and the request still reported success.  A researcher who selected
ten projects and archived nine was told nothing.  The 11 billed projects with no tblBilledProject
row are exactly this case.

Track a skippedAny flag alongside deniedAny, failedAny and hasFutureTimeAny, and add
error.project.archiveskipped to the report, so a partial batch says so.

Not tested.  See TESTS in ai-uwpr-webapp.

Co-Authored-By: Claude <noreply@anthropic.com>
…Script

front.jsp hid the archived list in a div revealed only by the #toggle_archived handler, and started
both bulk buttons disabled and enabled them only from updateArchiveButton.  With JavaScript off the
archived list, Unarchive Selected and Archive Selected never appeared or enabled.

* The archived list is now a native <details>/<summary>, which expands and collapses with no script.
  The #toggle_archived handler is gone
* Both submit buttons start enabled in the HTML.  The script still disables each until a checkbox in
  its table is checked, as an enhancement.  Submitting an empty selection is already handled by
  ArchiveProjectsAction

Not tested.  See TESTS in ai-uwpr-webapp.

Co-Authored-By: Claude <noreply@anthropic.com>
A SQLException, or any uncaught exception, reached the browser through the container's default error
page, which prints the exception message.  For the project search that message was the SQL itself,
with its table aliases and column list.  The search injection is already bound (PR #9), but any
other SQLException on any page leaks the same way.

* Added WebRoot/error.jsp, a self-contained page that logs the detail with a reference and shows the
  user only a generic message and that reference
* Registered it in web.xml for java.lang.Throwable and for status 500.  DTD 2.3 requires the
  error-page entries after welcome-file-list and before the taglibs

Not tested.  See TESTS in ai-uwpr-webapp.

Co-Authored-By: Claude <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The public error endpoint permits fabricated error logs, references can collide, and one failure message is misleading.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Improves archive controls without JavaScript, reports skipped archive operations, and adds generic server-error handling.

Changes:

  • Replaces JavaScript-only archive disclosure with native <details>.
  • Reports projects skipped during bulk archive operations.
  • Logs uncaught errors while showing users a reference ID.
File summaries
File Description
WebRoot/WEB-INF/web.xml Registers generic exception and HTTP 500 handling.
WebRoot/pages/internal/front.jsp Enables no-JavaScript archive controls.
WebRoot/error.jsp Adds sanitized error output and server-side logging.
src/PRMessageResources.properties Adds the skipped-project message.
src/org/yeastrc/www/project/ArchiveProjectsAction.java Tracks and reports skipped archive selections.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread WebRoot/WEB-INF/web.xml Outdated
Comment thread WebRoot/error.jsp Outdated
Comment thread src/PRMessageResources.properties Outdated
* Moved error.jsp under WEB-INF so only a container error dispatch reaches it. At the
  web root a direct request logged a spurious ErrorPage entry.
* Used a UUID for the error reference instead of currentTimeMillis, which two failures
  in the same millisecond could share.
* Reworded error.project.archiveskipped from "could not be found" to "could not be
  loaded", since the skip also covers a load failure or an invalid project type.

Co-Authored-By: Claude <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The changes are coherent, authorized correctly, and address the stated failure and fallback scenarios without unresolved issues.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

@vagisha
vagisha merged commit 7d00bda into master Sep 14, 2026
1 check passed
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