Conversation
Transaction#url returned a String after .create but an Array after getTransactionInfo, and callers had to parse the signer id out of the URL by hand. Replace it with sign_url (always a String) and signer_id (parsed from the URL). Stop fetching the transaction info eagerly in the constructor: it is now loaded lazily on first access to #data. .create no longer triggers a redundant getTransactionInfo call, and sign_url/signer_id are available without any extra request. BREAKING CHANGE: Transaction#url is removed; use sign_url / signer_id.
The transaction specs replayed recorded HTTP via VCR cassettes. Stub Universign::Client directly instead, delete the cassettes and the vcr/webmock/dotenv development dependencies, and use a static dummy configuration (no network is hit by the suite).
Universign::Document already supports a url param; add a test proving that a URL document flows through Transaction.create as a url (no base64 content), and note it in the changelog.
- rename TransactionSigner#birtdate= to #birthdate= (typo) - align Signer#first_name/#last_name readers with the keys written by the setters (firstname/lastname), keeping the API-response fallback - make Signer.from_data and Document.from_data thread-safe by building a fresh instance instead of mutating class-level state - implement Transaction#signers, mapping signerInfos to SignerInfos - expose Signer#data so SignerInfos accessors resolve Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- replace every raise "string" with typed Universign exceptions (UnknownOption, InvalidSignatureField, SignatureFieldsMustBeAnArray, CheckBoxTextsMustBeAnArray) - extract a translate_fault helper: match by fault code first, then fall back to fault-string matching - name the 73020 fault code (SIGNATURE_IN_PROGRESS) and document it - drop the unused safeguard callback machinery and the dead commented code in Service::Document - freeze AVAILABLE_OPTIONS and DEFAULT_OPTIONS Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- add Client.respond_to_missing? so respond_to?/method work through the XML-RPC delegation - add Client.call convenience and use it in the services, dropping the per-instance @client ivar (state leak) — still one client per call - remove the dead private Transaction#client and unused require/attrs - Document/Signer readers now derive from params instead of duplicating state in instance variables (content and meta_data keep their ivar: their stored representation genuinely differs from params) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- remove the obsolete .travis.yml (Ruby 2.2.2 CI, no longer used) - raise required_ruby_version to >= 3.0 - enable frozen_string_literal across lib/ - README: replace removed Transaction#url with sign_url/signer_id, document the new #signers accessor - CHANGELOG: document the v2 breaking changes Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- reorder kwargs so the required page: comes before the optional name: - drop the dead @params return value and the unused instance variables - use a bare signerIndex: symbol key for consistency with the others - add specs covering coordinates, default signer index, named field and the nil-coordinate fallback (the class had no coverage) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- add simplecov as a development dependency - start it at the top of spec_helper, filtering /spec/ and enabling branch coverage Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- cover TransactionSigner setters and signature_field validation - cover all SignerInfos accessors - cover Document signature_fields=/check_box_texts= validations and document_type - cover Transaction initiator/created_at/description/each_field and the nil signer_id path - cover Client delegation, unknown-method and respond_to? branches - cover Error.match_class and DocumentURLInvalid#to_s - cover the UnknownOption raise in Transaction.create - enforce minimum_coverage line: 100, branch: 100 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- activesupport '>= 4.1' -> '>= 7.0' (4.x/5.x do not run on Ruby 3+)
- pin a floor for xmlrpc ('>= 0.3')
- bump the bundler dev dependency floor to '>= 2.0'
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- fix grammar in the intro and add a Requirements section - document the lazy reload and the status/signers/documents accessors - add an Error handling section listing the typed exceptions - add an Upgrading from 1.x to 2.0 section - fix the Development instructions (bundle exec rspec / rake spec) and mention the enforced coverage Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
attr_accessor :phone_number generated a writer immediately overridden by the custom phone_number= setter. Use attr_reader so only the custom writer (which fills params[:phoneNum]) remains. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- run rubocop (capsens config: standardrb + capsens) autocorrect on the whole repository - mostly double-quoted strings, hash alignment, block delimiters and trailing commas - manually reflow the status / identification_type doc tables that exceeded the line length Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Universign now returns the signing URL with the signer id in the fragment
("https://app.universign.com/sig/#/?id=...") instead of the query string.
URI#query was nil for these URLs, so Transaction#signer_id returned nil and
callers could not identify the signer. Read the id from the query or the
fragment so both legacy and app.universign.com URLs are supported.
fix: parse signer_id from sign URL fragment
Author
|
@claude-review |
Author
|
Je m'occuperai de faire la release si ca te va |
AntoineBecquet
approved these changes
Jun 11, 2026
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.
Pourquoi
Transaction#urlrenvoyait un type incohérent — une String après.create, un Array aprèsgetTransactionInfo— et les consommateurs devaient extraire l'id du signataire en découpant l'URL à la main (url.split("id=")). Par ailleurs, le constructeur déclenchait systématiquement un appelgetTransactionInfo, même juste après.createoù l'on a déjà tout → un aller-retour réseau inutile.Cette PR porte la 2.0.0 : elle corrige ce point, puis nettoie en profondeur la gem (bugs, erreurs, archi), monte la couverture à 100 % et remet à jour outillage/doc/dépendances.
Changements (BREAKING → 2.0.0)
API de transaction
Transaction#url. Ajoute :Transaction#sign_url→ l'URL de signature, toujours une String (création ou rechargement).Transaction#signer_id→ l'id du signataire, parsé proprement depuis l'URL (?id=…).getTransactionInfon'est plus appelé dans le constructeur mais à la première lecture de#data(ou d'un attribut qui en dépend)..createne fait donc plus d'appel redondant, etsign_url/signer_idsont disponibles sans requête supplémentaire.Transaction#signersest implémenté (renvoyaitNotImplementedYet) et expose la progression sous forme deUniversign::SignerInfos.Corrections de bugs
TransactionSigner#birtdate=→#birthdate=.Signer#first_name/#last_namelisaient des clés que les setters n'écrivaient jamais → corrigé.Document.from_data/Signer.from_datane sont plus thread-unsafe (fini l'état partagé au niveau classe).Erreurs & robustesse
raise "string"deviennent des sous-classes typées deUniversign::Error(UnknownOption,InvalidSignatureField,SignatureFieldsMustBeAnArray,CheckBoxTextsMustBeAnArray).Safeguardsimplifié : code de faute73020nommé/documenté, matching par code avant fallback sur la chaîne, suppression du mécanisme de callback inutilisé et du code mort commenté.Archi & propreté
Client: ajout derespond_to_missing?et d'un helperClient.call, suppression du@clientstocké en ivar (fuite d'état) et duTransaction#clientmort. Toujours un client par appel (thread-safe, pas de pool — inutile pour cette charge).paramsdevient la source de vérité unique pourDocument/Signer(fin du double stockage@ivar+params, saufcontent/meta_datadont la représentation diffère réellement).SignatureFieldnettoyé (ordre des kwargs, valeur de retour morte, style des clés).Outillage, doc & dépendances
.travis.ymlobsolète (Ruby 2.2.2).required_ruby_version >= 3.0;frozen_string_literalsur toutlib/.activesupport >= 7.0,xmlrpc >= 0.3,bundler >= 2.0.Tests & couverture
minimum_coverage line: 100, branch: 100.bundle exec rspec→ 60 examples, 0 failures, 100 % de couverture lignes et branches.Migration côté consommateurs
Remplacer
transaction.url(+split("id=")) partransaction.sign_url/transaction.signer_id, etbirtdate:parbirthdate:. Voir la section « Upgrading from 1.x to 2.0 » du README. PR Swissroc à suivre (bump~> 2.0).