fix: resolve issues #129, #149, #165 - BatchWallet duplicate handling, Pin Gist API wiring, Terraform backend - #396
Closed
gbengaeben wants to merge 1 commit into
Closed
Conversation
…hainLabs#165 - BatchWallet duplicate handling, Pin Gist API wiring, Terraform backend config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR resolves three open issues assigned to @gbengaeben:
Closes #129 — BatchWallet: convert duplicate-within-batch panic into per-item Failure
batch_create_walletspanicked when the sameWalletCreateRequestappeared twice in one batch, making the operation atomic-or-nothing.WalletCreateResult::Failure(owner, DuplicateWallet)instead of panicking, allowing partial success for the rest of the batch.test_batch_create_wallets_partial_success_with_duplicatesthat verifies 5 requests with 2 duplicates yields 3 successes and 2 failures withDuplicateWalleterror code.contracts/batch-wallet/src/lib.rsCloses #149 — Wire Pin Gist form to real API with optimistic update
Map.tsxhandleAddGistonly appended to local state — no network call was sent.Frontend/src/api/gists.tswith typedpostGist()function callingPOST /gistshandleAddGistinMap.tsxto use optimistic insert: immediately add to local state, then replace with server-confirmed gist on success, or rollback on errorAddGistModal.tsxto use proper async loading flow (removed fake 2s timeout)AddGistModal.test.tsxto handle the async handler (all 9 tests pass)Frontend/src/api/gists.ts(new),Frontend/src/components/map/Map.tsx,Frontend/src/components/map/AddGistModal.tsx,Frontend/src/components/map/AddGistModal.test.tsxCloses #165 — Configure Terraform remote state + DynamoDB lock
infrastructure/terraform/backend.tfwith:PAY_PER_REQUEST, PITR, SSE)terraform { backend "s3" { ... } }block fromproviders.tftobackend.tfdata.aws_caller_identity.state_backendto avoid collision with the conditional data source inbackup-vaults.tfterraform init -migrate-state)infrastructure/terraform/backend.tf(new),infrastructure/terraform/providers.tfVerification
cargo check --target wasm32-unknown-unknown -p batch-wallet— compiles cleanlynpx tsc --noEmit— no new TypeScript errorsnpx vitest run— 71 tests pass (1 pre-existing unrelated test issue in Features.test.tsx)