Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: meta changes (non-default) also update metaHOC state #10734

Merged
merged 26 commits into from
Feb 25, 2022

Conversation

rishabhrathod01
Copy link
Contributor

@rishabhrathod01 rishabhrathod01 commented Jan 30, 2022

Description

Problem

  • When meta value changes from isDirty = true to isDirty = false on reset of inputWidget.
    Previous condition to update state compared metaValue to be equal to default value which in such cases aren't defined.

Solution

  • In metaHOC, we check if widget.meta has become empty => that only happens when we reset a widget, hence we initilise metaHOC state.

Fixes #9603
Fixes #11350
Fixes #6492

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Old test coverage

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Test coverage results 🧪

⚪ Total coverage has not changed
// Code coverage diff between base branch:release and head branch: fix/reset-metaHOC-staleState-9603 
Status File % Stmts % Branch % Funcs % Lines
🔴 app/client/src/widgets/MetaHOC.tsx 84.38 (-0.87) 53.85 (-4.04) 92.31 (0) 83.05 (-0.88)
🔴 app/client/src/widgets/InputWidgetV2/widget/index.tsx 73.6 (-0.17) 60.87 (-2.87) 81.25 (0) 72.95 (-0.16)

@vercel
Copy link

vercel bot commented Jan 30, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/get-appsmith/appsmith/Ggj1AsheBPcZBMMAKid4bGuppJkM
✅ Preview: https://appsmith-git-fix-reset-metahoc-stalestate-9603-get-appsmith.vercel.app

@github-actions github-actions bot added the Bug Something isn't working label Jan 30, 2022
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

2 similar comments
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@rishabhrathod01
Copy link
Contributor Author

/ok-to-test sha=e7e0e58

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1770886984.
Workflow: Appsmith External Integration Test Workflow.
Commit: e7e0e58.
PR: 10734.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1770886984.
Commit: e7e0e58.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Mean SD.Sample SD.Population
Click on table row
scripting 2459.92 2011.56 2044.93 1965.64 2059.78 2108.37 9.48 8.48
painting 74.5 14.97 13.05 14 11.23 25.55 107.24 95.93
rendering 289.07 242.93 233.13 229.28 229.78 244.84 10.35 9.25
Edit input
scripting 273.71 319.87 303.99 300.57 260.96 291.82 8.20 7.34
painting 6.79 16.29 15.86 25.03 17.65 16.32 39.77 35.60
rendering 13.84 16.46 30.54 16.33 17.3 18.89 35.15 31.45
Clear input
scripting 741.8 675.06 757.87 716.03 740.01 726.15 4.44 3.97
painting 7.06 10.98 10.6 9.44 7.63 9.14 19.15 17.07
rendering 192.82 165.46 183.89 180.63 176.82 179.92 5.57 4.98
Edit input again
scripting 311.25 333.15 295.61 269.8 307.05 303.37 7.64 6.83
painting 6.73 7.09 13.59 6.64 4.93 7.8 42.82 38.33
rendering 18.43 21.21 22.46 19.75 23.05 20.98 9.10 8.15

@rishabhrathod01
Copy link
Contributor Author

/ok-to-test sha=fc594b0

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1771900487.
Workflow: Appsmith External Integration Test Workflow.
Commit: fc594b0.
PR: 10734.

@rishabhrathod01 rishabhrathod01 self-assigned this Jan 31, 2022
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

1 similar comment
@github-actions
Copy link

Unable to find test scripts. Please add necessary tests to the PR.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1771900487.
Commit: fc594b0.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Mean SD.Sample SD.Population
Click on table row
scripting 2563.17 2214 2136.16 2177.51 2190.13 2256.19 7.71 6.89
painting 51.1 9.22 30.58 9.21 30.39 26.1 67.28 60.19
rendering 375.55 250.97 263.77 264.22 254.25 281.75 18.73 16.75
Edit input
scripting 284.17 365.83 308.22 301.83 281.14 308.24 11.09 9.92
painting 3.22 17.76 4.84 7.93 7.42 8.23 68.77 61.48
rendering 10.65 23.98 16.47 13.77 12.75 15.52 33.31 29.77
Clear input
scripting 741.98 752.52 765.23 721.25 714.47 739.09 2.87 2.56
painting 6.08 5.66 6.52 7 13.74 7.8 43.08 38.46
rendering 185.92 187.43 179.81 178.79 179.36 182.26 2.24 2.00
Edit input again
scripting 309.75 294.3 326.3 308.28 260.03 299.73 8.32 7.44
painting 7.02 7.82 8.43 4.59 11.93 7.96 33.42 29.90
rendering 19.53 23.33 21.5 17.57 17.62 19.91 12.56 11.25

@rishabhrathod01
Copy link
Contributor Author

/ok-to-test sha=d102c03

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1772453198.
Workflow: Appsmith External Integration Test Workflow.
Commit: d102c03.
PR: 10734.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1772453198.
Commit: d102c03.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Mean SD.Sample SD.Population
Click on table row
scripting 3071.97 2575.56 2629.05 2607.47 2620.52 2700.91 7.72 6.90
painting 40.36 15.33 10.93 18.23 10.8 19.13 64.14 57.40
rendering 411.32 274.76 270.38 303.16 283.91 308.71 19.02 17.02
Edit input
scripting 418.53 406.09 380.1 335.56 423.44 392.74 9.19 8.22
painting 40.94 15.07 16.77 41.51 9.75 24.81 61.31 54.82
rendering 19.01 25.28 15.14 14.45 18.77 18.53 23.21 20.78
Clear input
scripting 856.72 988.67 916.59 911.51 1218.74 978.45 14.54 13.01
painting 10.33 16.68 10.41 7.24 8.51 10.63 34.15 30.57
rendering 211.67 225.34 200.94 212.05 211.94 212.39 4.08 3.64
Edit input again
scripting 347.46 358.37 413.88 355.95 380.47 371.23 7.21 6.45
painting 5.38 9.91 15.79 6.67 28.02 13.15 70.19 62.81
rendering 23.39 22.66 35.3 23.7 25.72 26.15 20.04 17.90

@rishabhrathod01
Copy link
Contributor Author

/ok-to-test sha=6a81f2c

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1772756561.
Workflow: Appsmith External Integration Test Workflow.
Commit: 6a81f2c.
PR: 10734.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1772756561.
Commit: 6a81f2c.
Results:

Click to view performance test results

Run 1 Run 2 Run 3 Run 4 Run 5 Mean SD.Sample SD.Population
Click on table row
scripting 2782.45 2161.15 2119.9 2106.23 2081.82 2250.31 13.28 11.88
painting 35.83 9.08 20.84 14.84 10.32 18.18 59.90 53.58
rendering 835.35 248.89 243.67 230.67 229 357.52 74.75 66.86
Edit input
scripting 260.13 279.77 247.32 245.49 320.7 270.68 11.50 10.29
painting 3.85 26.21 45.32 26.5 7.03 21.78 77.36 69.19
rendering 12.33 13.02 12.66 13.41 17 13.68 13.89 12.43
Clear input
scripting 645.81 895.2 676.51 690.69 639.38 709.52 14.93 13.36
painting 4.59 4.72 5.89 5.34 4.9 5.09 10.41 9.23
rendering 167.58 158.2 158.21 160.27 170.54 162.96 3.52 3.14
Edit input again
scripting 386.5 318.1 266.12 279.57 333.17 316.69 15.05 13.46
painting 49.49 6.1 7.02 6.39 4.67 14.73 132.04 118.13
rendering 24.26 28.97 14.77 18.35 18.47 20.96 26.81 24.00

@rishabhrathod01
Copy link
Contributor Author

/ok-to-test sha=9454964

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1895233275.
Workflow: Appsmith External Integration Test Workflow.
Commit: 9454964.
PR: 10734.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1895233275.
Commit: 9454964.
Results:

Click to view performance test results

Median Mean SD.Sample SD.Population

@rishabhrathod01 rishabhrathod01 marked this pull request as ready for review February 24, 2022 21:33
@rishabhrathod01
Copy link
Contributor Author

Not sure why the previous review is not stale, please review it again.

@rishabhrathod01
Copy link
Contributor Author

/ok-to-test sha=0fc73f6

@github-actions
Copy link

Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/1899873490.
Workflow: Appsmith External Integration Test Workflow.
Commit: 0fc73f6.
PR: 10734.

@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1899873490.
Commit: 0fc73f6.
Results:

Click to view performance test results

Median Mean SD.Sample SD.Population

1 similar comment
@github-actions
Copy link

UI Performance test run logs and artifacts: https://github.com/appsmithorg/appsmith/actions/runs/1899873490.
Commit: 0fc73f6.
Results:

Click to view performance test results

Median Mean SD.Sample SD.Population

@rishabhrathod01 rishabhrathod01 merged commit 7a484fc into release Feb 25, 2022
@rishabhrathod01 rishabhrathod01 deleted the fix/reset-metaHOC-staleState-9603 branch February 25, 2022 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Javascript Product Issues related to users writing javascript in appsmith
Projects
None yet
3 participants