Skip to content

feat(login): enhance login process with improved error handling and U…#2543

Merged
robfrank merged 1 commit intomainfrom
fix/studio-login
Sep 22, 2025
Merged

feat(login): enhance login process with improved error handling and U…#2543
robfrank merged 1 commit intomainfrom
fix/studio-login

Conversation

@robfrank
Copy link
Collaborator

This pull request improves the login and database selection experience in ArcadeDB Studio by making the login process more robust, updating how user information is displayed, and enhancing error handling and diagnostics. The changes affect both backend and frontend code, resulting in clearer UI feedback, better diagnostics, and more reliable handling of login and database selection.

Frontend improvements:

  • Switched from using ARIA roles to HTML IDs for login dialog and credential fields in the E2E test, and added checks for login spinner and user display to improve test reliability.
  • Updated the UI to display the connected username in both the query and database tabs using the new queryUser and databaseUser elements instead of the generic user element. [1] [2]
  • Enhanced error handling and diagnostics in the login and database update JavaScript: added detailed logging, improved error messages for failed logins, ensured UI updates always occur after login, and made the AJAX request more robust (including a timeout and fallback notifications). [1] [2] [3]

Backend improvements:

  • Modified the database listing API response to include the server version and authenticated username, enabling the frontend to display more contextual information. [1] [2]

@robfrank robfrank merged commit 15abab5 into main Sep 22, 2025
6 of 11 checks passed
@robfrank robfrank deleted the fix/studio-login branch September 22, 2025 09:19
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @robfrank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refines the login and database selection experience within ArcadeDB Studio. It focuses on making the login process more reliable and user-friendly by enhancing error handling, providing clearer UI feedback, and improving diagnostic capabilities. The changes span both frontend and backend components, ensuring a more robust and informative interaction for users.

Highlights

  • Enhanced E2E Test Reliability: Updated E2E tests to use HTML IDs instead of ARIA roles for login elements, improving test stability and accuracy. Added explicit waits for login spinner and UI elements to ensure proper state transitions.
  • Improved User Display in UI: The connected username is now displayed more consistently across the UI using dedicated queryUser and databaseUser elements, replacing the generic user element.
  • Robust Frontend Error Handling: Implemented detailed logging, clearer error messages based on HTTP status codes, and a more resilient AJAX request with timeouts and fallback notifications for login and database updates. Invalid credentials are now cleared on failure.
  • Enriched Backend API Response: The database listing API (api/v1/databases) now includes the server version and the authenticated username in its response, providing more contextual information to the frontend.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request significantly enhances the login and database selection experience in ArcadeDB Studio. The changes are well-implemented, improving robustness, error handling, and diagnostics on both the frontend and backend. The E2E tests are made more reliable, and the UI feedback is much clearer. I have one suggestion to modernize a piece of JavaScript code for better maintainability and safety, but overall, this is an excellent set of improvements.

Comment on lines +91 to +94
for (let i in data.result) {
let dbName = data.result[i];
databases += "<option value='" + dbName + "'>" + dbName + "</option>";
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

For iterating over arrays, it's generally better to use for...of or array methods like forEach() or map() instead of for...in. The for...in statement iterates over all enumerable properties of an object, including inherited ones from the prototype chain, which can lead to unexpected behavior when used with arrays. Using for...of is safer, more idiomatic for array iteration, and clearly expresses the intent to loop over the array's values.

Suggested change
for (let i in data.result) {
let dbName = data.result[i];
databases += "<option value='" + dbName + "'>" + dbName + "</option>";
}
for (const dbName of data.result) {
// Using for...of is safer for arrays than for...in
databases += "<option value='" + dbName + "'>" + dbName + "</option>";
}

@codacy-production
Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 4515a271 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (4515a27) Report Missing Report Missing Report Missing
Head commit (9c4e9fb) 72449 45824 63.25%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#2543) 4 4 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

robfrank added a commit that referenced this pull request Nov 10, 2025
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.

1 participant