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

Updates oven page automatically when cookie is ready #6

Merged
merged 2 commits into from
Sep 12, 2020
Merged

Conversation

jchayan
Copy link
Owner

@jchayan jchayan commented Sep 12, 2020

  • Puts cookie retrieval markup in separate partial
  • Adds SSE support on ovens controller
  • Adds SSE listener on the client side

Issue: #5

- Puts cookie retrieval markup in separate partial
- Adds SSE support on ovens controller
- Adds SSE listener on the client side

Issue: #5
@jchayan jchayan self-assigned this Sep 12, 2020
@jchayan jchayan added the enhancement New feature or request label Sep 12, 2020
@jchayan jchayan merged commit be98387 into master Sep 12, 2020
@jchayan jchayan changed the title Issue 5 Updates oven page automatically when cookie is ready Sep 12, 2020
Copy link
Owner Author

@jchayan jchayan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs revert, 2 problems found (see the comments)

let cookieStatus, eventSource;

cookieStatus = document.querySelector('.cookie-status');
eventSource = new EventSource('/ovens/2/progress');
Copy link
Owner Author

@jchayan jchayan Sep 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded Oven ID

@@ -16,4 +19,19 @@ def empty
end
redirect_to @oven, alert: 'Oven emptied!'
end

def progress
@oven = Oven.find(params[:id])
Copy link
Owner Author

@jchayan jchayan Sep 12, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Security issue here: A User is able to query the Cookie status in other Users Ovens

@@ -1,4 +1,7 @@
class OvensController < ApplicationController
include ActionController::Live
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This causes RSpec to stop working for some reason I don't fully understand

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See issue #9 for more information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant