Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preset selection in session launcher does not match slider values #2958

Open
yomybaby opened this issue Dec 17, 2024 · 0 comments · Fixed by #2970
Open

Preset selection in session launcher does not match slider values #2958

yomybaby opened this issue Dec 17, 2024 · 0 comments · Fixed by #2970
Assignees
Milestone

Comments

@yomybaby
Copy link
Member

yomybaby commented Dec 17, 2024

When entering the session launcher, a preset is selected by default. However, the resource values displayed on the slider do not match the values defined in the selected preset. This inconsistency can lead to confusion for users expecting the preset values to be automatically reflected in the slider settings.

Steps to Reproduce

This bug reproduces occasionally.

  1. Open the session launcher.
  2. Observe that a preset is selected by default.
  3. Check the slider values for resources.
  4. Notice that the slider values do not match the preset's defined resource values.

Ref

@yomybaby yomybaby added this to the 24.09 milestone Dec 17, 2024
@yomybaby yomybaby self-assigned this Dec 17, 2024
yomybaby added a commit that referenced this issue Dec 23, 2024
…2970)

Resolves #2958

**Changes:**
To fix the inconsistency bug, refactored resource allocation preset handling in session launcher to improve reliability and maintainability:

1. Typo: renamed initial allocation preset from 'auto-preset' to 'auto-select'
2. Wrapped resource field update functions with useEventNotStable to prevent invoke useEffect unnecessary.
3. Consolidated preset selection logic into a single useEffect hook that handles:
   - Initial form setup when resourceSlots are loaded
   - Automatic preset selection based on available resources
   - Validation of accelerator type
4. Added separate useEffect for handling minimum-required preset updates when image changes

These changes make the resource allocation behavior more predictable and easier to maintain while fixing potential race conditions in the preset selection logic.

### Steps to Reproduce
I can reproduce with the dogbowl backend.
1. Navigate to the session list in the Backend.AI WebUI.
2. Refresh the browser.
3. Click the "Start Session" button.
4. Proceed to the second step of the session creation process.
5. Check the automatically selected preset.
6. Verify if the resources allocated match the selected preset.
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 a pull request may close this issue.

1 participant