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

Merge sessions into integration🎉🎊 #19

Merged
merged 87 commits into from
Mar 12, 2017
Merged

Conversation

helloqx
Copy link
Contributor

@helloqx helloqx commented Mar 11, 2017

Finally, issue #12 is resolved (hopefully) by our very own handler🎉 .

Some points:

  • I deployed it to test so you can test on the live site
  • OK linted
  • Clean local database before pulling
  • Heroku Timezone is probably US, cleaning of old sessions might be impacted if the heroku postgres timezone != Heroku Timezone (to note)
  • Consider when to clean old sessions: Database is currently cleaned with every successful login. Maybe clean on logout?
  • Validation of user done on every single page - might be laggy 😢 - to consider
  • Small visual bug in which registering a new account shows the base.html because outcome page is used

helloqx and others added 30 commits March 1, 2017 15:53
Commit for common code base
Commented out attempt to use native functions
using GQ ctx version over overwriting sessions handler

Conflicts:
	app.py
	components/handlers/index.py
	components/handlers/login.py
could login by running 'document.cookie="user=<any value>" in console
users could re-access a logged out account by entering 'document.cookie="user=<logged out user>' before the tab was closed.
@helloqx helloqx requested review from a0129998 and nlzz22 March 11, 2017 17:10
@nlzz22
Copy link
Contributor

nlzz22 commented Mar 11, 2017

@helloqx
Note: The live Heroku version crashes when I click on Modified Modules

@helloqx
Copy link
Contributor Author

helloqx commented Mar 12, 2017

@nlzz22 oh ya one thing i forgot to note: modified modules doesnt have test cases
I fixed it but havent deployed the new version yet

@tgqiang
Copy link
Contributor

tgqiang commented Mar 12, 2017

@helloqx Test cases for UI?

@helloqx
Copy link
Contributor Author

helloqx commented Mar 12, 2017

For not crashing (root.status == 200)
Cause all nose tests passed

@tgqiang
Copy link
Contributor

tgqiang commented Mar 12, 2017

@helloqx I was about to write the UI test cases after checking if Modified Modules needs any more changes for UI side. You have a base test case for that already?

@helloqx
Copy link
Contributor Author

helloqx commented Mar 12, 2017

I only have a 3 lines status == 200 test but haven't pushed, just write over ba

@helloqx
Copy link
Contributor Author

helloqx commented Mar 12, 2017

@nlzz22 @a0129998
okey pulled latest integration, ready for new review

@helloqx helloqx temporarily deployed to csmodify March 12, 2017 14:48 Inactive
raise web.seeother('/login')
input_data = web.input()
module_code = input_data.code
module_info = model.get_module(module_code)
if module_info is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

this means that it can't find the module right, so it's taking care of the instance where one user deletes a module and another user tries to view it at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, no.
It prevents the site from crashing when user accesses wrong module code

raise web.seeother('/login')

input_data = web.input()
module_code = input_data.code
module_info = model.get_module(module_code)
if module_info is None:
Copy link
Contributor

Choose a reason for hiding this comment

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

the 404 page is used in a few pages, would adding an error message be a good idea? is it going to be used in the final 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.

No, 404 is a temporary page

@@ -3,7 +3,8 @@
'''
from paste.fixture import TestApp
from nose.tools import assert_equal, raises
Copy link
Contributor

Choose a reason for hiding this comment

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

unused raises

delete_dummy_user_for_tests()
create_dummy_user_for_tests()
login_session_for_tests(test_app)

Copy link
Contributor

Choose a reason for hiding this comment

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

please use 2 newlines between functions

assert_equal(redirected.status, 200)
# checks if Validating page loaded
response.mustcontain(self.VALIDATING_TITLE)
assert_equal(response.status, 200)

Copy link
Contributor

Choose a reason for hiding this comment

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

why is here a assert_equal(response.status, 200) instead of the assert_equal(response.status, 303) we had previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Outcome() is loaded now instead of redirecting back to /login with error code

Copy link
Contributor

@nlzz22 nlzz22 left a comment

Choose a reason for hiding this comment

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

All files are linted as per comments given, passed all test cases. Session functions as intended.

@a0129998
Copy link
Contributor

All automated testcases passed, no errors found on deployed version through manual testing. sessions functions as intended. Pending test: 2 more more people logging in at the same time.

@a0129998
Copy link
Contributor

2 or more people logging in testing done. all behavior as expected. Pull request approved.

@a0129998 a0129998 closed this Mar 12, 2017
@a0129998 a0129998 reopened this Mar 12, 2017
Copy link
Contributor

@a0129998 a0129998 left a comment

Choose a reason for hiding this comment

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

All automated testcases passed, no errors found on deployed version through manual testing. sessions functions as intended.

@nlzz22 nlzz22 merged commit 6567727 into integration Mar 12, 2017
@nlzz22 nlzz22 deleted the sessions-bugfix branch March 12, 2017 17:17
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.

4 participants