You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/09/15 21:40:39 UTC

[GitHub] [couchdb] zachlankton opened a new pull request, #4178: Add test coverage to prevent junk in eventsource

zachlankton opened a new pull request, #4178:
URL: https://github.com/apache/couchdb/pull/4178

   ## Overview
   
   `eventsource` events should only ever contain `data`, `id`, `event`, or empty lines
   
   This PR adds a test to ensure that new code/changes will not break this rule
   
   ## Testing recommendations
   
   Pull this PR Branch into your local dev env and run the following commands:
   
   ```bash
   # reset the code back before the fix in PR #4176 
   git reset --soft 9fab3868de298b44b931a51d791b1d54bdc3c2ed
   git restore --staged src/chttpd/src/chttpd_db.erl
   git restore --staged src/global_changes/src/global_changes_httpd.erl
   git restore src/chttpd/src/chttpd_db.erl
   git restore src/global_changes/src/global_changes_httpd.erl
   
   # This test should fail
   make
   make elixir tests=test/elixir/test/changes_async_test.exs:110
   
   # Restore to latest commit including the fix
   git pull
   
   # The test should now pass
   make
   make elixir tests=test/elixir/test/changes_async_test.exs:110
   ```
   
   ## Related Issues or Pull Requests
   
   #4176 
   
   ## Checklist
   
   - [x] Code is written and works correctly
   - [x] Changes are covered by tests
   - [n/a] Any new configurable parameters are documented in `rel/overlay/etc/default.ini`
   - [n/a] Documentation changes were made in the `src/docs` folder
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] nickva commented on a diff in pull request #4178: Add test coverage to prevent junk in eventsource

Posted by GitBox <gi...@apache.org>.
nickva commented on code in PR #4178:
URL: https://github.com/apache/couchdb/pull/4178#discussion_r972451355


##########
test/elixir/test/changes_async_test.exs:
##########
@@ -103,6 +103,30 @@ defmodule ChangesAsyncTest do
     HTTPotion.stop_worker_process(worker_pid)
   end
 
+  @tag :with_db
+  test "eventsource no junk in response", context do
+    db_name = context[:db_name]
+
+    check_empty_db(db_name)
+    create_doc(db_name, sample_doc_foo())
+    create_doc_bar(db_name, "bar")
+    

Review Comment:
   In the editor this line I think was showing as having 4 spaces. Ideally it would be just a newline (without trailing whitespace).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [couchdb] nickva merged pull request #4178: Add test coverage to prevent junk in eventsource

Posted by GitBox <gi...@apache.org>.
nickva merged PR #4178:
URL: https://github.com/apache/couchdb/pull/4178


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org