Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Travel Advice Publisher is allowed to provide an empty intermediate response #63

Open
cbaines opened this issue Nov 10, 2017 · 2 comments

Comments

@cbaines
Copy link
Contributor

cbaines commented Nov 10, 2017

See #59 for the discussion.

Travel Advice Publisher has been seen to return a 200 OK, but without the content. Previously, this caused the end-to-end tests to fail, but this is now permitted, providing that the content appears at some point (after refreshing the page [1]).

I think its worth tracking this as something that could be investigated further in the future.

1: ae7954e#diff-cdf524a39d67474679c7b06d08bda552R69

@adrianclay
Copy link
Contributor

To give some more context attached is the log of what the travel advice publishing api sends.

First PUT has a blank content. Second PUT has the actual content.

#59 (comment) has what the travel advice frontend serves.

publishing-api_1                  | Started PUT "/v2/content/438a3cd3-5936-462d-b7ed-fff0ea485af1" for 172.18.0.2 at 2017-11-09 08:59:26 +0000
publishing-api_1                  | Cannot render console from 172.18.0.24! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
publishing-api_1                  | Processing by V2::ContentItemsController#put_content as JSON
publishing-api_1                  |   Parameters: {"base_path"=>"/foreign-travel-advice/congo", "document_type"=>"travel_advice", "schema_name"=>"travel_advice", "title"=>"Congo travel advice", "description"=>nil, "locale"=>"en", "publishing_app"=>"travel-advice-publisher", "rendering_app"=>"government-frontend", "routes"=>[{"path"=>"/foreign-travel-advice/congo", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo.atom", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo/print", "type"=>"exact"}], "public_updated_at"=>"2017-11-09T08:59:26Z", "update_type"=>"major", "details"=>{"summary"=>[{"content_type"=>"text/govspeak", "content"=>""}], "country"=>{"slug"=>"congo", "name"=>"Congo", "synonyms"=>[]}, "updated_at"=>"2017-11-09T08:59:26Z", "reviewed_at"=>"2017-11-09T08:59:26Z", "change_description"=>"", "email_signup_link"=>"/foreign-travel-advice/congo/email-signup", "parts"=>[], "alert_status"=>[], "max_cache_time"=>10}, "content_id"=>"438a3cd3-5936-462d-b7ed-fff0ea485af1", "content_item"=>{"base_path"=>"/foreign-travel-advice/congo", "document_type"=>"travel_advice", "schema_name"=>"travel_advice", "title"=>"Congo travel advice", "description"=>nil, "locale"=>"en", "publishing_app"=>"travel-advice-publisher", "rendering_app"=>"government-frontend", "routes"=>[{"path"=>"/foreign-travel-advice/congo", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo.atom", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo/print", "type"=>"exact"}], "public_updated_at"=>"2017-11-09T08:59:26Z", "update_type"=>"major", "details"=>{"summary"=>[{"content_type"=>"text/govspeak", "content"=>""}], "country"=>{"slug"=>"congo", "name"=>"Congo", "synonyms"=>[]}, "updated_at"=>"2017-11-09T08:59:26Z", "reviewed_at"=>"2017-11-09T08:59:26Z", "change_description"=>"", "email_signup_link"=>"/foreign-travel-advice/congo/email-signup", "parts"=>[], "alert_status"=>[], "max_cache_time"=>10}}}
--
publishing-api_1                  | Started PATCH "/v2/links/438a3cd3-5936-462d-b7ed-fff0ea485af1" for 172.18.0.2 at 2017-11-09 08:59:28 +0000
publishing-api_1                  | Cannot render console from 172.18.0.24! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
publishing-api_1                  | Processing by V2::LinkSetsController#patch_links as JSON
publishing-api_1                  |   Parameters: {"links"=>{"parent"=>["08d48cdd-6b50-43ff-a53b-beab47f4aab0"]}, "content_id"=>"438a3cd3-5936-462d-b7ed-fff0ea485af1", "link_set"=>{}}
--
publishing-api_1                  | Started PUT "/v2/content/438a3cd3-5936-462d-b7ed-fff0ea485af1" for 172.18.0.2 at 2017-11-09 08:59:29 +0000
publishing-api_1                  | Cannot render console from 172.18.0.24! Allowed networks: 127.0.0.1, ::1, 127.0.0.0/127.255.255.255
publishing-api_1                  | Processing by V2::ContentItemsController#put_content as JSON
publishing-api_1                  |   Parameters: {"base_path"=>"/foreign-travel-advice/congo", "document_type"=>"travel_advice", "schema_name"=>"travel_advice", "title"=>"Congo travel advice", "description"=>"", "locale"=>"en", "publishing_app"=>"travel-advice-publisher", "rendering_app"=>"government-frontend", "routes"=>[{"path"=>"/foreign-travel-advice/congo", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo.atom", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo/print", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo/the-stars-tennis-balls", "type"=>"exact"}], "public_updated_at"=>"2017-11-09T08:59:29Z", "update_type"=>"major", "details"=>{"summary"=>[{"content_type"=>"text/govspeak", "content"=>"Soluta suscipit harum molestias. In odio sed culpa. Similique quas dolorem necessitatibus optio reiciendis. 1510217967"}], "country"=>{"slug"=>"congo", "name"=>"Congo", "synonyms"=>[]}, "updated_at"=>"2017-11-09T08:59:29Z", "reviewed_at"=>"2017-11-09T08:59:29Z", "change_description"=>"Nisi pariatur similique omnis.", "email_signup_link"=>"/foreign-travel-advice/congo/email-signup", "parts"=>[{"slug"=>"the-stars-tennis-balls", "title"=>"The Stars' Tennis Balls", "body"=>[{"content_type"=>"text/govspeak", "content"=>"Minima dolorem eaque rerum."}]}], "alert_status"=>[], "max_cache_time"=>10, "image"=>{"url"=>"http://assets-origin.dev.gov.uk/media/5a0418f0d6cbfe000b5209f4/congo_map.jpg", "content_type"=>"image/jpeg"}, "document"=>{"url"=>"http://assets-origin.dev.gov.uk/media/5a0418f1d6cbfe000b5209f5/congo_travel_advice.pdf", "content_type"=>"application/pdf"}}, "content_id"=>"438a3cd3-5936-462d-b7ed-fff0ea485af1", "content_item"=>{"base_path"=>"/foreign-travel-advice/congo", "document_type"=>"travel_advice", "schema_name"=>"travel_advice", "title"=>"Congo travel advice", "description"=>"", "locale"=>"en", "publishing_app"=>"travel-advice-publisher", "rendering_app"=>"government-frontend", "routes"=>[{"path"=>"/foreign-travel-advice/congo", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo.atom", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo/print", "type"=>"exact"}, {"path"=>"/foreign-travel-advice/congo/the-stars-tennis-balls", "type"=>"exact"}], "public_updated_at"=>"2017-11-09T08:59:29Z", "update_type"=>"major", "details"=>{"summary"=>[{"content_type"=>"text/govspeak", "content"=>"Soluta suscipit harum molestias. In odio sed culpa. Similique quas dolorem necessitatibus optio reiciendis. 1510217967"}], "country"=>{"slug"=>"congo", "name"=>"Congo", "synonyms"=>[]}, "updated_at"=>"2017-11-09T08:59:29Z", "reviewed_at"=>"2017-11-09T08:59:29Z", "change_description"=>"Nisi pariatur similique omnis.", "email_signup_link"=>"/foreign-travel-advice/congo/email-signup", "parts"=>[{"slug"=>"the-stars-tennis-balls", "title"=>"The Stars' Tennis Balls", "body"=>[{"content_type"=>"text/govspeak", "content"=>"Minima dolorem eaque rerum."}]}], "alert_status"=>[], "max_cache_time"=>10, "image"=>{"url"=>"http://assets-origin.dev.gov.uk/media/5a0418f0d6cbfe000b5209f4/congo_map.jpg", "content_type"=>"image/jpeg"}, "document"=>{"url"=>"http://assets-origin.dev.gov.uk/media/5a0418f1d6cbfe000b5209f5/congo_travel_advice.pdf", "content_type"=>"application/pdf"}}}}

@cbaines
Copy link
Contributor Author

cbaines commented Nov 10, 2017

To give some more context attached is the log of what the travel advice publishing api sends.

First PUT has a blank content. Second PUT has the actual content.

Awesome Adrian, this would explain the behaviour seen in the tests.

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

No branches or pull requests

2 participants