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

[stable4] feat: Refactor form sync to run as a background job with retry #2424

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

Koc
Copy link
Collaborator

@Koc Koc commented Nov 21, 2024

This is backport of #2408 into stable4

@Koc Koc added this to the 4.3.4 milestone Nov 21, 2024
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (stable4@270fc5a). Learn more about missing BASE report.
Report is 29 commits behind head on stable4.

Additional details and impacted files
@@            Coverage Diff             @@
##             stable4    #2424   +/-   ##
==========================================
  Coverage           ?   36.07%           
  Complexity         ?     1037           
==========================================
  Files              ?       72           
  Lines              ?     3947           
  Branches           ?        0           
==========================================
  Hits               ?     1424           
  Misses             ?     2523           
  Partials           ?        0           

@Koc Koc force-pushed the backport/2408/stable4 branch from 4233652 to a2bd127 Compare November 21, 2024 00:06
@Koc
Copy link
Collaborator Author

Koc commented Nov 21, 2024

I've tested success flow manually and it's LGTM ✅ .

Scenario:

  1. created a form with short text question
  2. submit 2 answers
  3. link form with spreadsheet
  4. submit one more answer
  5. manually execute job using ./occ background-job:execute <job-id> --force-execute
  6. the latest answer is present in spreadsheet

@Chartman123
Copy link
Collaborator

@Koc same here as for the other backport :) please add the changes to newSubmissionLegacy(), too

@Koc Koc force-pushed the backport/2408/stable4 branch from a2bd127 to 2334d1b Compare November 21, 2024 16:58
@Koc
Copy link
Collaborator Author

Koc commented Nov 21, 2024

@Chartman123 ah, added

@Koc
Copy link
Collaborator Author

Koc commented Nov 21, 2024

I hope nobody against of merging it:

  • pipeline green
  • code review comments fixed
  • manual tests passed

@Koc Koc merged commit 8f30ecb into stable4 Nov 21, 2024
49 checks passed
@Koc Koc deleted the backport/2408/stable4 branch November 21, 2024 18:56
@toad
Copy link

toad commented Dec 16, 2024

@Koc @Chartman123 This is still broken at least for existing shares post upgrading to 4.3.4, because it does not correctly handle the upgrade.

We get this error:
"Undefined array key "attempt" at /var/www/html/custom_apps/forms/lib/BackgroundJob/SyncSubmissionsWithLinkedFileJob.php#62"

We have patched it locally by changing SyncSubmissionsWithLinkedFileJob.php line 62 to:
$attempt = isset($argument['attempt']) ? ($argument['attempt'] ?: 1) : 1;

It might be a php version issue though?

Copy link

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@Koc
Copy link
Collaborator Author

Koc commented Dec 17, 2024

@toad strange, I've tested it locally before merge. It seems like

$attempt = $argument['attempt'] ?: 1;

should be replaced with

$attempt = $argument['attempt'] ?? 1;

can you open PR to fix that?

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

Successfully merging this pull request may close these issues.

4 participants