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

catch validation error in typeform tasks to sync responses #296

Closed
wants to merge 1 commit into from

Conversation

s-kennedy
Copy link
Contributor

No description provided.

@@ -3,7 +3,7 @@ WORKDIR /opt/app/
COPY package.json /opt/app/
RUN apk --no-cache add --virtual native-deps \
g++ make python && \
npm install --quiet --production && \
npm install --no-optional --quiet --production && \
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is to force fsevents to install even though it's an optional dependency, otherwise it leads to a bunch of ugly warnings.

@@ -76,11 +77,11 @@ export default class RegistrationModal extends React.Component {
}
{
this.state.registration &&
<p>In order to save your learning circle, you need to register or <a onClick={this.toggleModalType}>log in.</a></p>
<p>In order to save your learning circle, you need to register or <a href="#" onClick={this.toggleModalType}>log in.</a></p>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is just to maintain the link styling

@@ -1,8 +1,6 @@
import React from 'react'
import InputWithLabel from 'p2pu-input-fields/dist/InputWithLabel'

Location
Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think this was a typo?

@@ -38,15 +38,15 @@
"lodash": "^4.17.11",
"moment": "^2.18.1",
"node-sass": "^4.9.3",
"p2pu-input-fields": "^0.5.9",
"p2pu-input-fields": "^0.5.10",
Copy link
Contributor Author

@s-kennedy s-kennedy Oct 30, 2018

Choose a reason for hiding this comment

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

This is where the production bug came from!

In p2pu-input-fields we're using a dependency, react-datepicker. The datepicker made changes in their latest version that are only compatible with React 16, so that was breaking our learning circle creation form.
Here's the issue: Hacker0x01/react-datepicker#1521

In p2pu-input-fields I fixed the version to 1.4.1, which fixed the bug, but it requires react 16 so I also upgraded react. According to the package-lock.json we were already using 15.6.2 so according to the release documentation we should be fine: https://reactjs.org/blog/2017/09/26/react-v16.0.html

I also tested the creation form and the course search and it's all good.

@@ -104,6 +106,8 @@ def sync_learner_responses():
study_group = StudyGroup.objects.get(uuid=study_group_id)
except ObjectDoesNotExist as e:
logger.debug('Study group with ID does not exist', e)
except ValidationError as e:
logger.debug('UUID is not valid', e)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

On typeform we have a few empty responses where the UUID is saved as xxxxx. I think it happens when someone fills out the form from the editing page on Typeform? Anyway it was throwing this error:

django.core.exceptions.ValidationError: ["'xxxxx' is not a valid UUID."]

So this catches the error, I ran the task locally and it got all the responses.

@s-kennedy s-kennedy closed this Oct 30, 2018
@dirkcuys dirkcuys deleted the fix_date_picker_bug branch October 31, 2018 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant