Commit graph

13770 commits

Author SHA1 Message Date
Pierre de La Morinerie
0e35bc609d notifications: don't preload dossiers on instructeurs
This request currently times out almost every night in production.

It's because although Instructeurs are loaded in batches (default batch
size is 1000), loading all dossiers for 1000 instructeurs is slow.

Turns out the code executed after this query to compute notifications
doesn't even use these dossiers. Indeed it is faster not to preload
them: both the initial query and the total treatment time are shorter.

Here's a quick benchmark made locally (but using production data):

- Before this commit:

	Benchmark.measure { pp Instructeur.includes(assign_to: { procedure: :dossiers }).where(assign_tos: { daily_email_notifications_enabled: true }).limit(100).m
ap(&:email_notification_data) }

Only the initial query : 35s
Total time : 97s

- Without preloading dossiers:

	Benchmark.measure { pp Instructeur.includes(assign_to: :procedure).where(assign_tos: { daily_email_notifications_enabled: true }).limit(100).m
ap(&:email_notification_data) }

Only the initial query : 0.08s (400x faster)
Total time : 29s (3,3x faster)

Plus it doesn't timeout, of course.
2021-12-09 12:10:00 +01:00
Paul Chavard
0a96e2f5a0
Merge pull request #6739 from tchak/feat-helpscout-tags
feat(helpscout): add a tag to messages submited through contact form
2021-12-09 12:00:40 +01:00
Paul Chavard
b67818e425 feat(helpscout): add a tag to messages submited through contact form 2021-12-09 11:47:13 +01:00
Paul Chavard
a0ce6fa388
Merge pull request #6738 from tchak/fix-graphql-nil-attestation
fix(graphql): do not crash if attestation is nil
2021-12-08 13:24:18 +01:00
Paul Chavard
efd8ddb99e fix(graphql): do not crash if attestation is nil 2021-12-08 13:12:42 +01:00
LeSim
dd380530ea
Merge pull request #6709 from betagouv/small_wording_fixes
Petites corrections textuelles
2021-12-08 11:25:29 +01:00
simon lehericey
3bdf6b63d9 small wording fixes 2021-12-08 11:19:30 +01:00
LeSim
afea30b9c9
Merge pull request #6733 from betagouv/zone-wording
Introduit dès à présent le concept de zone à l'administrateur
2021-12-08 10:59:59 +01:00
Christophe Robillard
4ffd25a321 introduce zone concept from now on 2021-12-08 10:56:17 +01:00
LeSim
e7b7bd8b7b
Merge pull request #6710 from adullact/feature/api-particulier-pole-emploi
[API Particulier] (3/4) Support de Pôle emploi
2021-12-08 10:43:00 +01:00
François Vantomme
6ab8ac0662 feat (api particulier): add Pole emploi field 2021-12-08 10:36:25 +01:00
François Vantomme
4cfc9f7d86 feat(api particulier): add Pole Emploi adapter 2021-12-08 10:36:11 +01:00
François Vantomme
2e05a3fde2 feat(api particulier): add Pole Emploi locales 2021-12-08 10:36:11 +01:00
François Vantomme
cfb8c184fe perf(api particulier): use filter_map instead of map.compact
https://docs.rubocop.org/rubocop-performance/cops_performance.html#performancemapcompact
2021-12-08 10:36:11 +01:00
François Vantomme
a24cf18c9d feat (api particulier): add Pole Emploi support to sources service 2021-12-08 10:36:11 +01:00
François Vantomme
62bc2efbaa style(api particulier): mentionne Pôle Emploi dans les locales 2021-12-08 09:49:53 +01:00
LeSim
8caa1e810e
Merge pull request #6731 from tchak/fix-set_dossiers_processed_at
fix(task): fix scope in set_dossiers_processed_at
2021-12-07 16:18:24 +01:00
Paul Chavard
a5b3bc1e79 fix(task): fix scope in set_dossiers_processed_at 2021-12-07 16:15:43 +01:00
Pierre de La Morinerie
8778b24110
Merge pull request #6723 from betagouv/fix-uri-encode 2021-12-07 15:29:42 +01:00
Pierre de La Morinerie
c75dba701d lib: replace URI.encode by CGI.escape
URI.encode was removed in Ruby 3.

Fix an error when adding a phone number to a Helpscout ticket.
2021-12-07 15:25:26 +01:00
Pierre de La Morinerie
799ca8e499
Merge pull request #6726 from betagouv/update-sentry 2021-12-07 15:17:06 +01:00
Pierre de La Morinerie
dc003113e6 gems: update sentry-rails to 4.8.1 2021-12-07 15:09:56 +01:00
Pierre de La Morinerie
f1c267fe81
Merge pull request #6729 from tchak/revert-fix 2021-12-07 15:09:36 +01:00
Paul Chavard
612b3bd82d fix(task): use dossier.read_attribute instead of direct read 2021-12-07 13:36:59 +01:00
Paul Chavard
5615baa985 Revert "Merge pull request #6724 from tchak/fix-approximative_expiration_date"
This reverts commit c95a67d970, reversing
changes made to 032989a400.
2021-12-07 13:32:39 +01:00
Paul Chavard
436569b08c Revert "Merge pull request #6727 from tchak/fix-approximative_expiration_date-again"
This reverts commit 951f974478, reversing
changes made to c95a67d970.
2021-12-07 13:32:27 +01:00
Pierre de La Morinerie
951f974478
Merge pull request #6727 from tchak/fix-approximative_expiration_date-again
Désactivation temporaire de l'expiration des dossiers
2021-12-07 13:09:59 +01:00
Paul Chavard
48ee830586 fix(dossier): fix approximative_expiration_date again 2021-12-07 13:02:53 +01:00
Pierre de La Morinerie
c95a67d970
Merge pull request #6724 from tchak/fix-approximative_expiration_date 2021-12-07 12:51:57 +01:00
Paul Chavard
60d4bcc4f7 fix(dossier): fix approximative_expiration_date 2021-12-07 12:47:27 +01:00
LeSim
032989a400
Ajoute le support du endpoint DGFIP de l'api particulier
[API Particulier] (2/4) Support de DGFiP
2021-12-07 11:09:00 +01:00
François Vantomme
2110ef072c feat(api particulier): add DGFiP field 2021-12-07 11:03:05 +01:00
François Vantomme
08405226b7 style(api particulier): fix a typo in CNAF tests 2021-12-07 11:03:05 +01:00
François Vantomme
f0913edebd feat(api particulier): add DGFiP adapter 2021-12-07 11:03:05 +01:00
François Vantomme
abad34ea7c feat(api particulier): add DGFiP locales 2021-12-07 11:03:05 +01:00
François Vantomme
97de7c197d feat(api particulier): add DGFIP support to sources service 2021-12-07 11:03:05 +01:00
François Vantomme
8ca8bdb6c4 fix(api particulier): correction d'une typo dans les locales 2021-12-07 11:03:05 +01:00
François Vantomme
4c8697656b style(api particulier): mentionne DGFIP dans les locales 2021-12-07 11:03:05 +01:00
Paul Chavard
e51d2235ed
Merge pull request #6668 from tchak/feat-add-parent-to-procedure-revision-type-de-champ
Add parent to procedure revision type de champ
2021-12-06 21:53:06 +01:00
Paul Chavard
5e0f8a5816 task(type_de_champ): migrate type_de_champ parent_id 2021-12-06 21:45:54 +01:00
Paul Chavard
09c37435ad feat(procedure_revision_types_de_champ): add parent_id 2021-12-06 21:45:54 +01:00
Paul Chavard
b83425896d
Merge pull request #6704 from tchak/feat-commune-departement
Display commune departement information
2021-12-06 21:08:00 +01:00
Paul Chavard
0036933425 feat(graphql): add commune and departement information to API 2021-12-06 21:01:28 +01:00
Paul Chavard
fcbe364ac8 feat(commune): display departement information on commune champ 2021-12-06 21:01:28 +01:00
Paul Chavard
ed2cbdc966 fix(champ): save departement name without code prefix 2021-12-06 20:58:08 +01:00
Paul Chavard
0a61056ea8
Merge pull request #6705 from tchak/fix-depose-at
fix(dossier): use depose_at instead of en_construction_at
2021-12-06 20:43:46 +01:00
Paul Chavard
2ba05bfb4f fix(dossier): use depose_at instead of en_construction_at 2021-12-06 15:49:17 +01:00
mfo
2bb013afaa
Merge pull request #6700 from betagouv/6671-etq-instructeur-rendre-l-expiration-plus-visible
6671 : ETQ instructeur, je veux savoir quand le dossier arrive a expiration
2021-12-06 13:15:38 +01:00
Martin
bb9b750ce9 merge(main): fix conflict 2021-12-06 13:11:46 +01:00
Martin
45a74ee999 clean(routes): based on review 2021-12-06 13:09:46 +01:00