Migration
This page tracks breaking changes between releases of the poli-page gem. While the gem is on 0.x, a breaking change bumps the minor version. For the full per-release diff, see the changelog.
From 0.11.0 to 0.13.0
Section titled “From 0.11.0 to 0.13.0”The SDK follows the Poli Page API contract v0.13.0 and now shares its major.minor with the Poli Page API, so there is no 0.12. The full guide is in MIGRATION.md in the repo.
Error#to_payloadnames its request id:requestId(was:request_id), so its JSON has the same keys in every Poli Page SDK. Readpayload[:requestId], notpayload[:request_id].- A 2xx whose body is not JSON raises
PoliPage::InvalidResponseError(invalid_response) instead ofInternalError(INTERNAL_ERROR). render_to_fileraisesPoliPage::FileWriteError(io_error) when it cannot write the file, instead ofInvalidOptionsError, and never leaves a partial file at the target.- The PDF download is bounded by
timeout:(60 s by default); a download that outlasts it raisesDownloadErrorwith the messageFailed to download PDF: timeout.
From 0.10.0 to 0.11.0
Section titled “From 0.10.0 to 0.11.0”The SDK follows the Poli Page API contract v1.3.0. The full guide is in MIGRATION.md in the repo.
- The keys inside
data:andmetadata:are sent exactly as written (no more camelizing), anddoc.metadatacomes back as stored, with String keys (doc.metadata["customerId"], notdoc.metadata[:customer_id]). Send the keys your template and your metadata readers expect. QUOTA_EXCEEDED,OVERAGE_CAP_EXCEEDEDandSTORAGE_ACCESS_DENIEDare no longer retried, andretryable?isfalsefor them.DOWNLOAD_FAILEDis neverretryable?.- The predicates read
statusandcode: aDownloadErrorwith a storage 403 is nowauth_error?. - SDK messages are the specification’s exact texts:
Network request failed,Request timed out after <ms>ms,Failed to download PDF: HTTP <status>,Failed to download PDF: network error,apiKey is required, andHTTP <status>for a non-JSON error body. Match oncode, notmessage. - An unknown
format:ororientation:is sent to the API, which answersPoliPage::ValidationError(400 VALIDATION_ERROR); the SDK no longer raisesInvalidOptionsErrorfor it. Check withPageFormat.valid?/Orientation.valid?if you want to refuse it first. - A nil or empty
project:raisesInvalidOptionsError(PROJECT_REQUIRED_FOR_DOCUMENT) before any request.
From 0.9.x to 0.10.0
Section titled “From 0.9.x to 0.10.0”0.10.0 follows the environments contract: an API key belongs to one environment (pp_sandbox_…, pp_live_…, pp_staging_…) and a render uses the project’s copy published in that environment. Every removal ships at once, with no deprecation window. The full guide, with before/after code, is in MIGRATION.md in the repo.
- Keys: the
pp_test_andpp_sa_prefixes are gone. Create a key in the environment you render in; asandboxkey replaces a test key. version:is removed fromrender.pdf,render.pdf_stream,render.documentandrender_to_file, andDocumentDescriptor#versionis gone. Publish the project to the key’s environment instead of pinning a version.render.previewand inline HTML are removed. Preview templates and inline HTML in the playground at play.poli.page.documents.preview(id)stays.ProjectModeInputis renamedRenderInput;InlineModeInputis removed.- Error codes:
GONEbecomesDOCUMENT_GONE,PAYMENT_REQUIREDbecomesORGANIZATION_PAYMENT_GRACE, and the version codes are gone. See Errors. documents.thumbnailsno longer checks its options on the client: an out-of-bounds option raisesPoliPage::ValidationErrorfrom the API instead ofPoliPage::InvalidOptionsError.
The first release. Its surface is documented in MIGRATION.md in the repo.