fix(adt): reuse an object's existing open transport on write instead of 409-ing (#144)#145
Open
zooloo303 wants to merge 1 commit into
Open
fix(adt): reuse an object's existing open transport on write instead of 409-ing (#144)#145zooloo303 wants to merge 1 commit into
zooloo303 wants to merge 1 commit into
Conversation
When the caller supplies no transport, fall back to the request the object is already bound to (LockResult.CorrNr) instead of binding the write to a new request and hitting 409 ExceptionResourceLockConflict. The fallback re-checks transportable-edit policy so it never bypasses --allow-transportable-edits. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Fixes #144. When editing an object that is already captured in an open transport
request of the current user, vsp binds the write to a new request, and SAP
rejects it with:
ADT / Eclipse reuse the lock's existing request automatically. This does the same:
when the caller supplies no
transport, fall back to the request SAP already returnson the LOCK response as
LockResult.CorrNr.Change
New helper
resolveWriteTransport(supplied, lockCorrNr, opName)(
pkg/adt/transport_reuse.go), wired in right after the lock in the primary updateentry points:
WriteProgram,WriteClass(pkg/adt/workflows.go)EditSourceWithOptions(pkg/adt/workflows_edit.go)Safety
The fallback re-runs
checkTransportableEditon the resolved request, so auto-reusecannot bypass
--allow-transportable-editsor the--allowed-transportswhitelist. An explicitly-supplied transport is used unchanged (already gated at the
top-level mutation gate). A local object (no open request) is unchanged (empty
transport).
Tests
TestResolveWriteTransportcovers explicit-wins, local/no-op, fallback-when-allowed,and the safety-critical case where the fallback is blocked because transportable
edits are disabled.
go test ./pkg/adt/...is green.Verified live against an on-prem system: editing an object already bound to an open
request now succeeds without the caller supplying the transport (previously a
409), and the object is left clean afterwards.
Scope / follow-up
Covers PROG/CLAS full-source writes and surgical
EditSource(any object type). Thesame one-line reuse applies to
writeSourceUpdate(INTF/DDLS/BDEF/SRVD),writeClassMethodUpdate, andUpdateFromFile— happy to fold those in if you'dprefer one comprehensive change; kept minimal here for reviewability.
Note: this touches the same write paths as #125 / #108; it composes cleanly with them
(verified by stacking all three locally and exercising the combined path live).