mirror of
https://github.com/lfnovo/open-notebook.git
synced 2026-07-25 07:36:30 +00:00
* fix(frontend): actually clear credential fields when emptied in the edit dialog Clearing base_url (or the Vertex project/location/credentials_path) in the credential edit dialog silently did nothing: the submit handler mapped an emptied field to `undefined`, JSON.stringify dropped the key from the PUT body, and the backend's partial-update semantics kept the old value — while the UI reported success. Emptied fields are now sent as an explicit `null`, which the API already accepts and persists as a cleared value (verified live). UpdateCredentialRequest's nullable fields are typed accordingly. Found in v1.11 release testing (pre-existing, not a release regression): an Ollama credential with a stale IP in base_url could not be cleared from the UI. * fix(api): clear credential fields on explicit null, not just empty string The update handler guarded every field with 'is not None', so a JSON null sent to clear base_url (or endpoint/api_version/endpoint_*/ project/location/credentials_path/num_ctx) was silently skipped — the old value survived while the client saw a 200. Combined with the frontend bug fixed in the previous commit (emptied fields dropped from the payload entirely), clearing a credential field was impossible from the UI: during release testing an Ollama credential kept pointing at a stale IP after being 'cleared', and only an empty-string PUT crafted by hand actually cleared it. Field updates are now keyed on presence in model_fields_set: absent keeps the old value, explicit null or "" clears. name/modalities/ api_key keep their non-null guards (clearing those is not meaningful). Regression tests cover null-clears, empty-string-clears, absent-keeps and the Vertex credentials_path case. * test(frontend): extract credential update payload builder and cover clear-on-empty Addresses the cubic review: the frontend half of the fix had no reproducing test. The edit dialog's payload construction now lives in a pure buildCredentialUpdatePayload() (frontend/src/lib/ credential-update-payload.ts) used by the component, with tests that fail on the original bug: an emptied base_url (and Vertex project/ location/credentials_path) must survive JSON.stringify as an explicit null, unchanged fields must be omitted, and emptied num_ctx clears via 0. |
||
|---|---|---|
| .. | ||
| conftest.py | ||
| README.md | ||
| test_add_insight_failure_propagation.py | ||
| test_chunking.py | ||
| test_config_endpoint_no_leak.py | ||
| test_connection_test_classification.py | ||
| test_cors_credentials.py | ||
| test_credential_provider_validation.py | ||
| test_credentials_api.py | ||
| test_crud_404.py | ||
| test_domain.py | ||
| test_embedding.py | ||
| test_embedding_commands.py | ||
| test_error_message_sanitization.py | ||
| test_graphs.py | ||
| test_max_body_size_middleware.py | ||
| test_models_api.py | ||
| test_note_save_embed_resilience.py | ||
| test_notes_api.py | ||
| test_order_by_validation.py | ||
| test_podcast_audio_containment.py | ||
| test_podcast_job_status_batching.py | ||
| test_podcast_path.py | ||
| test_recently_viewed_api.py | ||
| test_repository_config.py | ||
| test_search_api.py | ||
| test_source_create_array_limits.py | ||
| test_source_path_containment.py | ||
| test_sources_api.py | ||
| test_startup_migration_retry.py | ||
| test_transformations_api.py | ||
| test_upload_toctou_race.py | ||
| test_upload_type_mitigations.py | ||
| test_url_validation.py | ||
| test_utils.py | ||
| test_vertex_credentials_file_oracle.py | ||
Coming Soon