Skip to content

[HOLD for payment 2022-11-18] [$250] Attachments - Preview is broken for Protected PDF file (iOS and Android) #12480

Closed

Description

@kbecciv

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Action Performed:

  1. Launch the app
  2. Log in with any account
  3. Attach any protected PDF file
  4. Open the PDF file

Expected Result:

Preview is not broken for Protected PDF file

Actual Result:

Preview is broken for Protected PDF file

Workaround:

Unknown

Platform:

Where is this issue occurring?

  • iOS
  • Android

Version Number: 1.2.24.0

Reproducible in staging?: Yes

Reproducible in production?: Yes

Email or phone of affected tester (no customers):

Logs: https://stackoverflow.com/c/expensify/questions/4856

Notes/Photos/Videos: Any additional supporting documentation

RPReplay_Final1667585840.MP4

Expensify/Expensify Issue URL:

Issue reported by: Applause - Internal Team

Slack conversation:

View all open jobs on GitHub

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Nov 4, 2022
  2. melvin-bot commented on Nov 4, 2022

    @melvin-bot

    Triggered auto assignment to @conorpendergrast (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. syedsaroshfarrukhdot commented on Nov 5, 2022

    @syedsaroshfarrukhdot
    Contributor

    Proposal

    The issue is in PDFView index.native.js as we need to pass height and width to KeyboardAvoidingView

    {this.state.shouldRequestPassword && (
    <KeyboardAvoidingView>
    <PDFPasswordForm
    onSubmit={this.attemptPdfLoadWithPassword}
    onPasswordUpdated={() => this.setState({isPasswordInvalid: false})}
    isPasswordInvalid={this.state.isPasswordInvalid}
    shouldShowLoadingIndicator={this.state.shouldShowLoadingIndicator}
    />
    </KeyboardAvoidingView>

    We need to pass styles style={[styles.w100, styles.h100]} to KeyboardAvoidingView

    After Fixing :-

    Screen Shot 2022-11-05 at 7 56 44 AM

    Screen Shot 2022-11-05 at 8 00 36 AM

  4. 0xmiroslav commented on Nov 6, 2022

    @0xmiroslav
    Contributor

    Proposal

    This is a regression from #11586 which replaced our own KeyboardAvoidingView with default react native KeyboardAvoidingView.
    And react-native KeyboardAvoidingView isn't vertically stretched by default.

    Solution:
    https://github.com/Expensify/App/blob/main/src/components/PDFView/index.native.js

                <View style={containerStyles}>
                    {this.state.shouldAttemptPdfLoad && (
                        <TouchableWithoutFeedback style={touchableStyles}>
                            <PDF
                                trustAllCerts={false}
                                renderActivityIndicator={() => <FullScreenLoadingIndicator />}
                                source={{uri: this.props.sourceURL}}
                                style={pdfStyles}
                                onError={this.initiatePasswordChallenge}
                                password={this.state.password}
                                onLoadComplete={this.finishPdfLoad}
                            />
                        </TouchableWithoutFeedback>
                    )}
                    {this.state.shouldRequestPassword && (
    -                    <KeyboardAvoidingView>
    +                    <KeyboardAvoidingView style={styles.flex1}>
                            <PDFPasswordForm
                                onSubmit={this.attemptPdfLoadWithPassword}
                                onPasswordUpdated={() => this.setState({isPasswordInvalid: false})}
                                isPasswordInvalid={this.state.isPasswordInvalid}
                                shouldShowLoadingIndicator={this.state.shouldShowLoadingIndicator}
                            />
                        </KeyboardAvoidingView>
                    )}
                </View>

    NOTE:

    We don't need to stretch horizontally (styles.w100) because:

    • When isSmallScreenWidth = true, containerStyles has it already

      const containerStyles = this.state.shouldRequestPassword && this.props.isSmallScreenWidth
      ? [styles.w100, styles.flex1]
      : [styles.alignItemsCenter, styles.flex1];

    • When isSmallScreenWidth = false, styles.alignItemsCenter added but in PDFPasswodForm containerStyle width manually set to 350

      const containerStyle = this.props.isSmallScreenWidth
      ? [styles.flex1, styles.w100]
      : styles.pdfPasswordForm.wideScreenWidth;

  5. changed the title [-]Attachments - Preview is broken for Protected PDF file[/-] [+]Attachments - Preview is broken for Protected PDF file (iOS and Android)[/+] on Nov 7, 2022
  6. conorpendergrast commented on Nov 7, 2022

    @conorpendergrast
    Contributor
    • The bug is not a duplicate report of an existing GH
    • The bug is reproducible, following the reproduction steps: Reproduced on iOS
    • The GH template is filled out as fully as possible -- this means the GH body and title are clear
    • The GH was created by an Expensify employee or a QA tester.
    • If the bug is an OldDot issue, you should decide whether it is widespread enough to justify fixing or it is better to wait for reunification. If it’s better to wait, close the GH & provide this justification.
    • Decide if the GH should be resolved by an External contributor or Internal engineer: External!

    Testing file, password is Password:
    Password Protected.pdf

  7. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Nov 7, 2022
  8. melvin-bot commented on Nov 7, 2022

    @melvin-bot

    Current assignee @conorpendergrast is eligible for the External assigner, not assigning anyone new.

  9. melvin-bot commented on Nov 7, 2022

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

  10. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Nov 7, 2022
  11. 19 remaining items

  12. melvin-bot commented on Nov 8, 2022

    @melvin-bot

    📣 @0xmiroslav You have been assigned to this job by @thienlnam!
    Please apply to this job in Upwork and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
    Keep in mind: Code of Conduct | Contributing 📖

  13. conorpendergrast commented on Nov 10, 2022

    @conorpendergrast
    Contributor

    The job:

    Ok, I'm following this process to hire via Upwork. I'm hiring:

  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Nov 11, 2022
  15. changed the title [-][$250] Attachments - Preview is broken for Protected PDF file (iOS and Android)[/-] [+][HOLD for payment 2022-11-18] [$250] Attachments - Preview is broken for Protected PDF file (iOS and Android)[/+] on Nov 11, 2022
  16. melvin-bot commented on Nov 11, 2022

    @melvin-bot

    The solution for this issue has been 🚀 deployed to production 🚀 in version 1.2.26-0 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

    If no regressions arise, payment will be issued on 2022-11-18. 🎊

  17. mvtglobally commented on Nov 16, 2022

    @mvtglobally

    Issue not reproducible during KI retests. (First week)

  18. tgolen commented on Nov 16, 2022

    @tgolen
    Contributor

    Hi all, due to the work I did in #11586, which probably forced a regression in this area, please don't hold any regressions against the contributor.

  19. JmillsExpensify commented on Nov 16, 2022

    @JmillsExpensify
    Contributor

    Ok great, thanks for the heads up! Noted, though we'll still wait for the regression period to pass.

  20. conorpendergrast commented on Nov 17, 2022

    @conorpendergrast
    Contributor

    Thanks Tim! Note to myself: Two days until we pay out :👍

  21. conorpendergrast commented on Nov 21, 2022

    @conorpendergrast
    Contributor

    It is time, so I shall pay using this SO: How do I pay an external contributor via Upwork?

    I am paying these two people: #12480 (comment)

    Assignment date: 2022-11-09 #12480 (comment)
    Merge date: 2022-11-09 #12547 (comment)

    That fits: Merged PR within 3 business days - 50% bonus

    So that makes base of $250 each plus 50% bonus of $125 = $375.

    Pay $375 and end contract on:

    And finally:

    • Close the job

    All done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions