bountybot-'s People
bountybot-'s Issues
Add the default .prettierrc file for the project
currently, some parts of linting have to be done manually as if we try to auto-format it, it creates issues with things like tabWidth
ClientSync activity errors out when bounty marked paid on web
The ClientSync.ts file is missing the case for Activities.paid, which causes it to error out whenever a bounty is marked as paid on the web side. Doesn't hurt anything, but creates annoying errors in the error log.
Activities.paid should just be a no-op
Check if there are other missing activities
Handle missing canonical cards
If the canonical card gets deleted, updating the card will fail. It should try to recreate it in that case.
Here in BountyUtils.canonicalCard, if getMessagfromMessageId fails:
if (!!bounty.canonicalCard) { // If we still have an existing card, just edit it, remove old reactions
bountyChannel = await DiscordUtils.getTextChannelfromChannelId(bounty.canonicalCard.channelId);
cardMessage = await DiscordUtils.getMessagefromMessageId(bounty.canonicalCard.messageId, bountyChannel);
await cardMessage.edit(cardEmbeds);
await cardMessage.reactions.removeAll();
} else { // Otherwise create it. Put it in the passed in channel, or customer channel by default
if (!bountyChannel) bountyChannel = await DiscordUtils.getBountyChannelfromCustomerId(bounty.customerId);
try {
List not displaying "claimable by" correctly
This bounty is assigned to mridge, but shows as "claimable by anyone" in the list
https://discord.com/channels/834499078434979890/897955883219296268/999633794325811251
Allow for multiple gated roles
Right now the for-role only allows for one entry. The db model supports multiple, but the bounty create does not.
improvement: lists in DM's link back to main channel list
DM’ed lists should include a button to link back to the main channel list (outside of the individual bounty links), similar to the link we provide on bounties
More informative error messaging for users
Our bounty activities wrap three logically distinct but ordered processes:
- updating the bounty data model for the respective activity (I.e. marking a bounty as claimed)
- updating the bounty card with the new bounty data
- notifying the users in the interaction
Our current architecture means that runtime errors in either of those two functions result in the same error message (Sorry something is not working and our devs are looking into it.
)
However, most errors with the bot come from steps 2 or 3. If the bounty data model has been updated, users can go to the web to find an accurate representation of the bounty.
Ideally, we can find some sort of smart way to tell users that in a disaster scenario their bounty has been updated, but that the failure means the bounty card will be stale until a fix/update is pushed.
Tech debt | Refactor Create activity into methods for standard Create activity and IOU Create activity
At first IOU didn't have enough difference in functionality that it made sense to separate from the standard Create activity.
Within the recent addition of a wallet flow specifically to IOUs, things are getting a little unwieldy.
Help messages from SOS reaction fail if DMs aren't enabled
If permissions aren't correct, put the message in a channel and @ the intended recipient.
Pull customers from customer DB instead of customers constant
Instead of using the list of customers in the Customers constants file, use the Customers database collection. Then we can add customers without a code change
improvement: notification messages also use bounty cards
Change notification messages to also use buttons to link to the bounty instead of a hyperlinked url, keeping the web url as hyperlinked text
When bounty published from web, bot errors trying to update the current list
2 cases:
- Create a new bounty on the web and publish it. Error in DiscordUtils.refreshLastList trying to get user from request.buttonInteraction
- Publish a bounty on the web created as a draft on the bot. To do this you need to copy the bounty ID on the bot, and go to /. Click Publish. Get same error
Rewrite Milestone 1 todo
Collating Todo items.
We're still at the stage on the bot rewrite where individual issues for each bug fix/feature improvement is more of a hassle.
edit: Striking out todo items as they get resolved, thanks @tescher for the call out
@tescher succinctly captured everything on my radar and more:
1. I assume the hard-coded guild id needs to be fixed, either reading from the DB or a list in the .env file
2. 'Please go to #🧀-bounty-board to take action.' is hard-coded. Should this name come from a channel ID in .env?
3. Some other TODOs I saw, like the board URL
4. Can we change the name "HashId" in the view to "Bounty Id"? The /bounty command calls it that.Other things I saw off the bat:
1. 'no or 'skip' doesn't work for the date, even though the instructions reference them.
2. If you don't publish right away, the "Bounty Bot is thinking..." never goes away.
In general, since this is a rewrite, a thorough unit test probably needs to be developed and completed. Write down all options and branches, and systematically run through them all. I don't have time to do that, but it should be done.
One other thing I just saw - I put 2022-01-31 as the deadline date, and it is showing as Sunday, January 30, 2022. Timezone issue?
Some items on my list: (not in order of priority)
1.deleting draft in create DMs has weird behavior (screenshot below)
3. Reconsider out draft --> open flow. Currently there isn't a sensible way to stop at draft (perhaps that's desired to force users through the full create and publish flow?) and pick it up later.
4. Db name and collection names are currently hardcoded
5. List activity works, but send an ephemeral fail fast in the command context channel
6.gating auth handler allows non-allowlisted roles to claim a bounty
7. delete error seen below:
Paid Status items missing from model
paidAt and the the paidBy object are missing from the Bounty and BoutnyCollection models
Minor Bot UX upgrades
Improvements after we merge #57 to production:
If possible, don't reply to the message that will be deleted so that there is no linkage to "Message could not be loaded".
In the applicant flow for apply-for
bounties, provide a link back to the bounty list
Error on delete
Didn't have time to investigate, putting here for now. I manually marked the bounty as deleted (it was Open previously)
Bounty ID is 62fd8403d5268300534fa228
Card is here: https://discord.com/channels/834499078434979890/998408674873716787/1009615887063597129
{
"_account": "6d9735d3af",
"_cluster": "ld83",
"_host": "67de8f81-8c1f-4f97-b316-3392fe7698b7",
"_ingester": "@logdna/logger/2.6.0",
"_logtype": "meta",
"_file": "REWRITE_PROD",
"_line": "error",
"_rawline": null,
"_ts": 1664395053296,
"_app": "REWRITE_PROD",
"_meta": {
"name": "TypeError",
"message": "Cannot read properties of undefined (reading 'bountyId')",
"stack": "TypeError: Cannot read properties of undefined (reading 'bountyId')\n at handler (/app/dist/app/activity/bounty/Handler.js:21:59)\n at default_1.interactionHandler (/app/dist/app/events/InteractionCreate.js:250:41)\n at default_1.execute (/app/dist/app/events/InteractionCreate.js:62:20)\n at Client. (/app/dist/app/app.js:40:54)\n at Client.emit (node:events:513:28)\n at InteractionCreateAction.handle (/app/node_modules/discord.js/src/client/actions/InteractionCreate.js:74:12)\n at module.exports [as INTERACTION_CREATE] (/app/node_modules/discord.js/src/client/websocket/handlers/INTERACTION_CREATE.js:4:36)\n at WebSocketManager.handlePacket (/app/node_modules/discord.js/src/client/websocket/WebSocketManager.js:351:31)\n at WebSocketShard.onPacket (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:444:22)\n at WebSocketShard.onMessage (/app/node_modules/discord.js/src/client/websocket/WebSocketShard.js:301:10)"
},
"_ip": "10.30.34.17",
"__key": "logline:6d9735d3af:REWRITE_PROD:67de8f81-8c1f-4f97-b316-3392fe7698b7:ld83",
"level": "ERROR",
"_bid": "819f91db-c233-47d1-b1ff-0c87702961ec:64094:ld83",
"_id": "1528383630669168642"
}
Backup notifications need to @ the user intended
It looks like if someone submits a bounty for review, and the creator doesn't have DMs turned on, it sends the message to the bounty channel. This is fine, but it also needs to @ the creator so they are notified. Also check all other notifications to make sure they do this.
If a bounty is created for a specific user, send that user a message after bounty is created
assignTo is set in the Create activity, but no message goes out to the user so they don't know it.
"Back To List" button is a link that takes you back to potentially stale list
Back To List button is implemented as a link back to the list that was current when that bounty card was created. Find out if there is a way to implement it as an action that will get the latest list off the customer record and go to that instead.
/bounty help command never exits
When doing
/bounty help
you see the correct help message, but the message "..bot is thinking..." never goes away
Edit compatibility between Bot and Web
If a bounty is edited on the web, it doesn't redraw the canonical card on the Bot, in fact it errors out with an invalid activity. Should use the new refresh activity in #44
Due date is sensitive to time zone
I live at UTC-9, and when I enter a due date for a bounty, it frequently displays it as the previous day. I think because it is already the next day UTC time when I create the bounty. The date should display as entered.
improvement: after bounty is created, automatically refresh list
Currently, once a bounty is created, a user will need to click "Back to List" and then "refresh" to see the created bounty on the main list of bounties. The second action with hitting "refresh" will be confusing for users - they aren't aware of the technical challenge we have with doing this, and it's an un-intuitive UI
After a bounty is created, I'd like the list to be automatically refreshed so that the user doesn't have to hit "refresh"
Tech debt | Null handling for db queries in activity methods
Currently, we perform validation on the status of a bounty by checking for the correct status in our validation module. If we don't find the correct status, we serve an error message to the user detailing that the bounty is not in the expected status for that activity.
e.g,
if (dbBountyResult.status && dbBountyResult.status !== BountyStatus.open) {
throw new ValidationError(
`The bounty id you have selected is in status ${dbBountyResult.status}\n` +
`Currently, only bounties with status ${BountyStatus.open} can be applied for.\n` +
`Please reach out to your favorite Bounty Board representative with any questions!`
);
}
By the time the bounty has made it to the activity, a few ms have passed. It's possible, though very very improbable, that the bounty status has been updated in that time by the web client. Thus in the activity, we add status as a field to our queries, so that a null result is returned if the bounty is not longer in the state we expect. This causes a Runtime exception, and the user is served a "Sorry, something isn't working and our devs are looking into it" error message.
e.g,
const getDbHandler = async (request: SubmitRequest): Promise<{dbBountyResult: BountyCollection, bountyChannel: string}> => {
const db: Db = await MongoDbUtils.connect('bountyboard');
const bountyCollection = db.collection('bounties');
const customerCollection = db.collection('customers');
const dbBountyResult: BountyCollection = await bountyCollection.findOne({
_id: new mongo.ObjectId(request.bountyId),
status: BountyStatus.in_progress,
});
A better UX would be to serve a validation exception (as that is the actual cause of why the activity can't proceed). This needs to be implemented for all of our activities.
Dynamic List Metadata
The new Bounty Board List in Discord shows "claimable by..." for each bounty. This should change depending on the bounty status and the list type.
For the public list and the Created By Me list:
- If status is In Progress thru Complete, replace "claimable by .." with "claimed by <user>"
For the Claimed By Me list:
- If status is In Progress thru Submitted, replace "claimable by..." with the due date
- If status is Complete. replace "claimable by..." with the Paid Status
Sync up permissions with the web side
The web side has implemented granular permissions per Discord role ("claim-bounties", "create-bounties", etc.). Support this on the bot side.
/bounty help doesn't ask for bounty id
missing a command option
Notify Claimant when their bounty is marked as paid
discordUtils.activityNotification() call when the claimant's bounty has been marked paid so they can follow-up if needed.
bounty.assign and assignedName and bounty.gate should use user object model
In the Bounty model, we usually save users as { discordId, discordHandle }. We should do this for bounty.assign/assignedName and bounty.gate. Will make for less caching and db lookups. Will require a db conversion.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.