* Issue 10209 - Remove read usages of zone
* Issue 10209 - Add coverage on daysSince and startOfDay cron utility functions
* Issue 10209 - Add unit test for daysUserHasMissed method
* Issue 10209 - Remove usages of deprecated `moment.js#zone` method.
* Issue 10209 - Add helper function to centralise logic
Also simplify timezoneOffsetToUtc function in site.vue
* Issue 10209 - Also add getUtcOffset as method on user
Co-authored-by: Matteo Pagliazzi <matteopagliazzi@gmail.com>
* simplify ip address management by using the trust proxy express option
* add setupExpress file
* fix redirects middleware tests
* fix lint
* short circuit the ip blocking middleware
* basic implementation with ip based limiting
* improve logging
* upgrade apidoc
* apidoc: add introduction section
* fix lint
* fix tests
* fix lint
* add unit tests for rate limiter
* do not send retry-after header when points are available
* automatically fix lint
* fix more lint issues
* use userId as key for rate limit when available
* simplify ip address management by using the trust proxy express option
* add setupExpress file
* fix redirects middleware tests
* fix lint
* short circuit the ip blocking middleware
* basic implementation with ip based limiting
* improve logging
* upgrade apidoc
* apidoc: add introduction section
* fix lint
* fix tests
* fix lint
* add unit tests for rate limiter
* do not send retry-after header when points are available
* automatically fix lint
* fix more lint issues
* use userId as key for rate limit when available
* add run-rs to dependencies
* wip: add replica set to api unit github action
* wip: add replica set to api unit github action
* wip: fix gh actions mongodb replica set setting
* usa replica set for integration tests
* add correct mongodb version matrix for integration tests
* use different db connection on gh actions
* Revert "use different db connection on gh actions"
This reverts commit aa8db759d3.
* add example transaction
* add mongo script to package.json
* abstract mongodb utils, connect using hostname on windows
* npm scripts: mongo -> mongo:dev
* add setup script for run-rs on windows
* gh actions: run in test environment
* remove test files
* better error handling, use cross-spawn to avoid issues on windows
* fix lint
* Getting the latest code
* Temporary fix for Redundant Party Invite. Needs changes.
* Added logic to check if the user is an existing member of the party that the user is invited to.
* Added a test case for redundant party invite check.
* Changed the test case for redundant party invite to see if it runs successfully.
* Made changes to the test cases.
* Fixed lint errors.
* Removed the exclusive mocha test.
* Referred the issue in the name of the new test case.
* Modified test case to check its veracity.
* Checking if the update statement is working or not.
* Piggybacking the updating of user tag list.
When a new task is being added to a challenge, added code to update user tag list along with the existing code that already involves syncing / updating the user documents of challenge members.
* Update comment on number of simulatenaeous users to be updated concurrently in TaskQueue.
* Added comment to explain previous commit caaca469f8 (Update comment on number of simulateneous users to be updated concurrently in TaskQueue)
* Added unit tests for testing commit caaca469f8 (Update comment on number of simulateneous users to be updated concurrently in TaskQueue)
* Removed unused lines from newly added test cases
* Implemented lint suggestions
* Update code with changes requested in PR
* Fix bug where updated webhook options failed to save
This bug was caused by Mongoose not creating getters/setters for array
elements (https://mongoosejs.com/docs/faq.html#array-changes-not-saved).
So, although the webhook was being updated properly, Mongoose was not
actually committing it to the database. Telling Mongoose that the array
of webhooks has changed via `markModified` fixes the issue.
Additionally, the relevant API test case was only checking whether or
not the webhook returned from the PUT endpoint matched the expected
update. Since the endpoint was returning the updated webhook without
querying the database again, this test case would pass. It has been
updated to check both the returned webhook as well as the version of the
webhook that is saved to the database against the expected. In other
words:
`assert returned === saved === expected`
Fixes#12336
* Call markModified on webhook.options instead of user.webhooks
This tells Mongoose that only the modified webhook's options changed
instead of telling it that the entire user.webhooks array changed,
saving a costly DB update.
* fix(chat) - Don't insert user link in url-less link and properly log source-mapping failures
* fix(chat) - Add link to markdown spec and list of known issues
* fix(chat) - Log regular expression as String
* Issue 10924 - Don't break up links with mention links
* Issue 10924 - Recognise links between brackets.
* Issue 10924 - Rely on markdown parser for link determination
* Issue 10924 - Only increment index once in findTextBlocks
* Issue 11050 - Small tuneups to unlock.js
- Use includes i.o. indexOf
- Extract small function for object setting duplication
- Use every instead of custom counter
* Issue 11050 - Properly store purchased items when purchasing them
* Issue 11050 - Couple more tuneups in unlock.js and implemented partial failure scenario
* Issue 11050 - Fix last lint issue
* Issue 11050 - Check path for gear i.o. failing to write it to purchased
* Issue 11050 - Guarantee variation coverage in tests
* Issue 11050 - Use startsWith instead of includes for background check
* Issue 11050 - Don't unlock lost items
* Improve whitespacing in highlightMentions.js unit test
* Issue 11504 - Don't link users in markdown code blocks
Use the markdown-it parser to determine what parts of the message are code block first.
Then work from those parser tokens back to content parts that should not be handled.
Still convoluted, but can be improved once a "user mention plugin" is added to habitica-markdown.
* Issue 11504 - Put functions in JavaScript order and fix linting issues
* Issue 11504 - Use includes i.o. multiple or checks and added some context.
* Issue 11504 - Add docstring for highlightMentions and simplify fence regex
* Issue 11504 - Replace inline recursor with default parameter value
* add date check
* achievements modal polishing
* refresh private-messages page when you are already on it
* add countbadge knob to change the example
* fix lint
* typos
* typos
* typos
* add toggle for achievements categories
* typo
* fix test
* fix edit avatar modal cannot be closed
* WIP(settings): subscriber page improvements
* WIP(subscriptions): more design build-out
* fix(css): disabled button styles
* fix(css): better Amazon targeting
* fix hide tooltip + align header correctly
* disable perfect scroll
* load messages on refresh event
* fix header label + conversation actions not breaking layout on hover
* WIP(g1g1): notif
* WIP(g1g1): notif cont'd
* fix(test): snowball change
* fix(event): feature NYE card
* chore(sprites): compile
* fix(bgs): include TT required field
* add gifting banner to the max height calculation
* chore(event): enable winter customizations
* WIP(gifting): partial modal implementation
* feat(gifting): select giftee modal
* fix(gifting): notification order, modal dismiss
* Begin implementing sign in with apple
# Conflicts:
# package-lock.json
# website/common/script/constants.js
# website/server/libs/auth/social.js
# website/server/models/user/schema.js
* Add apple sign in button to website
* fix lint errors
* fix config json
* fix(modals): correct some repops
* fix(gifting): style updates
* fix(buy): modal style changes
* fix(modals): also clean out "prev"
* Attempt workaround for sign in with apple on android
* temporarily log everything as error
* refactor(modals): hide in dismiss event
* fix temporary test failure
* changes to sign in with apple
* fix: first batch of layout issues for private messages + auto sizing textarea
* fix(modals): new dismiss logic
* fix(modals): new dismiss no go??
* Only use email scope
* print debugging
* .
* ..
* ...
* username second line - open profile on face-avatar/conversation name - fix textarea height
* temporarily disable apple auth and just return data for debugging
* Hopefully this works
* .....
* WIP(subscription): unsubscribed state
* .
* ..
* MAYBE THIS ACTUALLY WORKS???
* Implement apple sign in
* fix some urls
* fix urls
* fix redirect and auth
* attempt to also request name
* fix lint error
* WIP(subscription): partial subscribed
* chore(sprites): compile
* Change approach so that it actually works
* fix config error
* fix lint errors
* Fix
* fix lint error
* lint error
* WIP(subscription): finish subscribed
* refresh on sync
* new "you dont have any messages" style + changed min textarea height
* new conversationItem style / layout
* reset message unread on reload
* chore(npm): update package-locks
* fix styles / textarea height
* feat(subscription): revised sub page RC
* list optOut / chatRevoked informations for each conversation + show why its disabled
* Improve apple redirect view
* Fix apple icon on group task registration page
* WIP(adventure): prereqs
* Block / Unblock - correct disabled states - $gray-200 instead of 300/400
* canReceive not checking chatRevoked
* fix: faceAvatar / userLink open the selected conversation user
* check if the target user is blocking the logged-in user
* fix(subs): style tweaks
* fix(profiles): short circuit contributor
Attempted fix for #11830
* chore(sprites): compile
* fix(content): missing potion data
* fix(content): missing string
* WIP(drops): new modal
* fix(subs): moar style tweaks
* check if blocks is undefined
* max-height instead of height
* fix "no messages" state + canReceive on a new conversation
* WIP(adventure): analytics fixes etc
* Improve apple signin handling
* fixed conversations width (280px on max 768 width page)
* feat(adventure): random egg+potion on 2nd task
* fix(lint): noworkies
* fix(modal): correctly construct classes
* fix(tests): expectations and escape
* Fix typo
* use base url from env variables
* fix lint
* call autosize after message is sent
* fix urls
* always verify token
* throw error when social auth could not retrieve id
* Store emails correctly for apple auth
* Retrieve name when authenticating through apple
* Fix lint errors
* fix all lint errors
* fix(content): missing strings
* Revert "always verify token"
This reverts commit 8ac40c76bf.
# Conflicts:
# website/server/libs/auth/social.js
* Correctly load name
* remove extra changes
* remove extra logger call
* reset package and package-lock
* add back missing packages
* use name from apple
* add support for multiple apple public keys
* add some unit and integration tests
* add apple auth integration test
* tweak social signup buttons
* pixel pushing
Co-authored-by: Matteo Pagliazzi <matteopagliazzi@gmail.com>
Co-authored-by: Sabe Jones <sabrecat@gmail.com>
Co-authored-by: negue <eugen.bolz@gmail.com>
Co-authored-by: Phillip Thelen <phillip@habitica.com>
* fix(webhooks): don t parse response as json
* upgrade got to version 10
* remove old header
* fix tests
* fix email auth
* add migration
* update email error
* split migration in two