Skip to content

closes #108: cache crash #113

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

Merged
merged 2 commits into from
Mar 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web-app/src/containers/New/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ interface TutorialsData {
}

const NewPageContainer = (props: ContainerProps) => {
const { data, loading, error } = useQuery<TutorialsData>(queryTutorials)
const { data, loading, error } = useQuery<TutorialsData>(queryTutorials, {
fetchPolicy: 'no-cache',
})

if (error) {
return <ErrorView error={error} />
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/containers/Overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Overview = (props: PageProps) => {
throw new Error('Tutorial not found in summary page')
}
const { loading, error, data } = useQuery<TutorialData, TutorialDataVariables>(queryTutorial, {
fetchPolicy: 'network-only', // to ensure latest
fetchPolicy: 'no-cache', // to ensure latest
variables: {
tutorialId: tutorial.id,
// version: tutorial.version.version, // TODO: re-enable latest
Expand Down
5 changes: 1 addition & 4 deletions web-app/src/services/apollo/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import ApolloClient, { InMemoryCache } from 'apollo-boost'
import ApolloClient from 'apollo-boost'
import { GQL_URI } from '../../environment'
import { authorizeHeaders } from './auth'

export const cache = new InMemoryCache()

const client = new ApolloClient({
uri: GQL_URI,
request: authorizeHeaders,
cache,
})

export default client
1 change: 1 addition & 0 deletions web-app/src/services/apollo/queries/tutorials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default gql`
description
}
version {
id
publishedAt
publishedBy {
id
Expand Down
3 changes: 3 additions & 0 deletions web-app/src/services/state/actions/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ const contextActions: ActionFunctionMap<T.MachineContext, T.MachineEvent> = {
const position: T.Position = selectors.defaultPosition()
return position
},
processes() {
return []
},
}),
// @ts-ignore
setError: assign({
Expand Down
2 changes: 1 addition & 1 deletion web-app/src/services/state/machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export const createMachine = (options: any) => {
},
Completed: {
id: 'completed-tutorial',
onEntry: ['userTutorialComplete'],
onEntry: ['userTutorialComplete'], // unusued
on: {
SELECT_TUTORIAL: {
target: '#select-new-tutorial',
Expand Down