Try adding cache-busting back to DashboardController

pull/1112/head
Rick Carlino 2019-02-11 10:12:01 -06:00
parent e6b154602b
commit 000b23facd
5 changed files with 7 additions and 6 deletions

View File

@ -65,6 +65,8 @@ class DashboardController < ApplicationController
# If you don't do this, you will hit hard to debug
# CSP errors on local when changing API_HOST.
response.headers["Cache-Control"] = "no-cache, no-store"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "0"
load_css_assets
load_js_assets
render actn

View File

@ -7,7 +7,7 @@ if Rails.env == "development"
ENV['OS_UPDATE_SERVER'] = "http://non_legacy_update_url.com"
# CREDIT: Faker Ruby Gem
VEGGIES = %w(artichoke arugula asparagus broccoli
cabbage carrot cauliflower celery chive cornichon cucumber
cabbage carrot cauliflower celery chive cucumber
eggplant endive garlic jicama kale kohlrabi leek lettuce okra onion
parsnip pepper potato pumpkin radicchio radish raspberry rhubarb spinach
squash tomato turnip zucchini)

View File

@ -59,7 +59,7 @@ describe("Actions", () => {
storeToken(old, dispatch)(undefined);
expect(setToken).toHaveBeenCalledWith(old);
expect(didLogin).toHaveBeenCalledWith(old, dispatch);
expect(console.warn).toHaveBeenCalledWith(expect.stringContaining(
"Failed to refresh token"));
expect(console.warn)
.toHaveBeenCalledWith(expect.stringContaining("Can't refresh token."));
});
});

View File

@ -8,7 +8,7 @@ import { timeout } from "promise-timeout";
export const storeToken =
(old: AuthState, dispatch: Function) => (_new: AuthState | undefined) => {
const t = _new || old;
(!_new) && console.warn("Failed to refresh token. Something is wrong.");
(!_new) && console.warn("Can't refresh token. Is API_HOST set correctly?");
dispatch(setToken(t));
didLogin(t, dispatch);
};

View File

@ -8,7 +8,7 @@ import { maybeNegateStatus } from "../connectivity/maybe_negate_status";
import { EdgeStatus } from "../connectivity/interfaces";
import { ReduxAction } from "../redux/interfaces";
import { connectivityReducer } from "../connectivity/reducer";
import { versionOK, fancyDebug } from "../util";
import { versionOK } from "../util";
import { EXPECTED_MAJOR, EXPECTED_MINOR } from "./actions";
import { DeepPartial } from "redux";
import { incomingLegacyStatus } from "../connectivity/connect_device";
@ -129,7 +129,6 @@ export let botReducer = generateReducer<BotState>(initialState(), afterEach)
return s;
})
.add<DeepPartial<HardwareState>>(Actions.STATUS_UPDATE, (s, { payload }) => {
fancyDebug({ payload });
s.hardware = {
...s.hardware,
...(payload as typeof s.hardware)