fix: preserve case of customSubscriptionEmail and customSubscriptionFooter (#1849) - #1851
Open
jacalata wants to merge 1 commit into
Open
fix: preserve case of customSubscriptionEmail and customSubscriptionFooter (#1849)#1851jacalata wants to merge 1 commit into
jacalata wants to merge 1 commit into
Conversation
…ooter (#1849) RequestFactory.Site.update_req and create_req called `str(value).lower()` on customSubscriptionEmail and customSubscriptionFooter when serializing to XML, silently mangling caller intent: site.custom_subscription_email = "[email protected]" site.custom_subscription_footer = "Sent by Tableau -- Confidential." server.sites.update(site) # server received: customSubscriptionEmail="[email protected]" # customSubscriptionFooter="sent by tableau -- confidential." Impact: - Email: cosmetic only (SMTP treats mailboxes case-insensitively in practice), but recipients see the wrong-case "from" address. - Footer: functionally broken. The footer is displayed verbatim in outgoing subscription emails, so lowercasing removes company-name casing, sentence capitalization, brand terms, etc. Anyone setting a customer-facing footer via TSC got a mangled result with no workaround short of the web UI. Drop the .lower() on both string values in both code paths. The paired *Enabled boolean attributes still get .lower()d (they need to serialize as "true"/"false"), just the string values are now sent verbatim. Discovered while implementing tabcmd editsite parity (tableau/tabcmd#437, tabcmd PR #452). Fixes #1849.
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
RequestFactory.Site.update_reqandcreate_reqcalledstr(value).lower()oncustomSubscriptionEmailandcustomSubscriptionFooterwhen serializing to XML, silently mangling caller intent.Impact
Verification
Read the server-side code path to confirm the server does not itself lowercase these fields:
RestApiSiteParamsBuilder.setCustomEmail/setCustomEmailFooterattab-api-restapi-all/.../RestApiSiteParamsBuilder.java:461-488— pure passthrough from request payload intowithCustomReplyToEmail/withCustomEmailFooter.SiteParams.withCustomReplyToEmail/withCustomEmailFooterattab-domain-site-interfaces/.../SiteParams.java:671-680— direct assignment to member fields.Site.setCustomReplyToEmailattab-domain-site/.../entity/Site.java:495-497— direct assignment; JPA columncustom_subscription_email.SiteParamsValidator.java:170validates the email is a well-formed address; does not modify case. Footer has no validation.toLowerCase()anywhere in the server-side write chain.Cross-checked against tabcmd Classic (which uses a different ClientXML endpoint but same user-facing semantics): Classic sends both strings verbatim as multipart form parts (
EditSite.java:179-182,StringPart.java:33-36). No case normalization on the Classic client side either.Fix
Drop
.lower()on both string values in bothupdate_reqandcreate_req. The paired*Enabledboolean attributes still get.lower()'d (they need to serialize as"true"/"false") — just the string values are now sent verbatim.Closes #1849.
Test plan
test/test_site.py— one forupdate_req, one forcreate_req, both asserting the exact case of email + footer survives to the XML request bodytest_site.pysuite: 28 passedDiscovered while
Implementing tabcmd editsite parity (tableau/tabcmd#437, tableau/tabcmd#452).
🤖 Generated with Claude Code