Coder Social home page Coder Social logo

bountybot-'s People

Contributors

behold3th avatar dependabot[bot] avatar mofejesu1 avatar tescher avatar thedarkrai07 avatar

Watchers

 avatar  avatar  avatar

bountybot-'s Issues

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 {

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.

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)
Screen Shot 2022-01-11 at 12 43 08 AM
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:
Screen Shot 2022-01-13 at 1 31 32 AM

Minor Bot UX upgrades

Improvements after we merge #57 to production:

Screen Shot 2022-08-25 at 6 43 33 PM

If possible, don't reply to the message that will be deleted so that there is no linkage to "Message could not be loaded".

Screen Shot 2022-08-25 at 6 44 41 PM

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.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.