@@ -408,34 +408,17 @@ def check_bundle_link_params(bundle, request_params)
408408 uri = URI ( link )
409409 bundle_params = URI . decode_www_form ( uri . query ) . to_h
410410
411- # TODO: There is currently a bug in the API where the `Bundle.link` value for `-immunization.target` is
412- # incorrectly returned as `immunization.target` rather than `-immunization.target`. Matt Jarvis has
413- # told me that this should be fixed in their next release (3) or possibly release 4, at which point we
414- # can remove this logic.
415- tweaked_bundle_params =
416- bundle_params . transform_keys do |key |
417- key == "immunization.target" ? "-immunization.target" : key
418- end
419- # TODO: They recently introduced another bug (presumably in the process of fixing their old bug), where they
420- # now use `immunization-target`. This has only been seen in their staging environment, and we have notified
421- # them, so hopefully this never reaches production. In the meantime we need to be able to test and demo
422- # against their INT environment, and need to be robust against this bug in case it makes its way into prod.
423- tweaked_bundle_params =
424- tweaked_bundle_params . transform_keys do |key |
425- key == "immunization-target" ? "-immunization.target" : key
426- end
427-
428411 # We don't care about the order of the target values
429- tweaked_bundle_params [ "-immunization.target" ] = tweaked_bundle_params [
412+ bundle_params [ "-immunization.target" ] = bundle_params [
430413 "-immunization.target"
431414 ] &.split ( "," ) &.sort
432415 request_params [ "-immunization.target" ] = request_params [
433416 "-immunization.target"
434417 ] . split ( "," ) . sort
435418
436- unless tweaked_bundle_params == request_params
419+ unless bundle_params == request_params
437420 message =
438- "Bundle link parameters do not match request parameters: #{ tweaked_bundle_params } != #{ request_params } "
421+ "Bundle link parameters do not match request parameters: #{ bundle_params } != #{ request_params } "
439422 Rails . logger . warn ( message )
440423 if Flipper . enabled? ( :imms_api_sentry_warnings )
441424 Sentry . capture_exception ( BundleLinkParamsMismatch . new ( message ) )
0 commit comments