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

Feat/workerize #96

Open
wants to merge 153 commits into
base: development
Choose a base branch
from
Open

Conversation

Keyrxng
Copy link
Contributor

@Keyrxng Keyrxng commented Oct 30, 2024

Resolves #92

@Keyrxng

This comment was marked as off-topic.

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Feb 28, 2025

Marked as off-topic because I was forward thinking things instead rather than for the npm package, my bad.

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Feb 28, 2025

PermitRequests previously sent username instead of user.id. We can either update the invoker or I can revert that change and fetch their GH ID?

This is the only important sentence to address before we can merge this and address the other problems in a separate PR

const { type, amount, username, contributionType, tokenAddress } = permitRequest;

this is still backward-compatible, right? just the function signature changed (no more context, just permit requests), so we can keep using it as a library until everything is ready

We could release a new major and we'd be safe no matter what I'm sure, I figured that's what we'd be doing.

@whilefoo
Copy link
Member

whilefoo commented Mar 1, 2025

PermitRequests previously sent username instead of user.id. We can either update the invoker or I can revert that change and fetch their GH ID?

I think user id and wallet address should be passed in because we already fetch wallet address in text-conversation-rewards so it doesn't make sense to do it twice. permit-generation should be minimalistic and only focus on generating permits

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Mar 2, 2025

I'm assuming you are talking about in regards to the npm package, but once permit generation is centralized to the worker I assume that it will be responsible for the user checks and pushing to the DB?

Kept userId and added userWalletAddress so we will need to update text-conversation.

I haven't touched the encode/decode methods or the types associated with them because that would break pay.ubq I'm sure so that can be left until the worker is rolled out.

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Mar 10, 2025

@0x4007 @rndquu what do i need to do to get this merged dudes?

@0x4007
Copy link
Member

0x4007 commented Mar 11, 2025

I think if it can pass @whilefoo review it's fine.

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Mar 11, 2025

I ask again because ofc it's been highlighted through this PR that the spec wasn't clear as @whilefoo pointed out.

This PR has sat for a long time with v little input or changes. Each new review is something else that's newly being considered for this feature.

It's not right and it's not fair either. Can this be moved along, please?

What ever else needs done or considered for this feature should be tasked out and a clear considered spec written for it.

@Keyrxng
Copy link
Contributor Author

Keyrxng commented Mar 11, 2025

Different when your salaried, you don't mind if these situations occur because your still earning at the end of the day.

You don't mind waiting for shit to be clarified and the team to get on the same page with things.

When your just a contributor it's a completely different story. And situations like this need to be avoided and remedied quickly where it cannot be avoided.

PRs/tasks like these are what I've seen make newer devs stop contributing within the ecosystem more than anything else.


If this feature isn't due to be used or rolled out or whatever then merge to a feature branch without a new release.

Whatever it is that needs done, can it be done please.

@0x4007
Copy link
Member

0x4007 commented Mar 11, 2025

@gentlementlegen perhaps you can bring it to the next step


I think that the contribution dynamics will be normalized soon. It's part of the inspiration behind removing base pay.

logger.info("Generating permit for: ", permitRequest);
const { amount, userId, nonce, evmNetworkId, tokenAddress, type: permitType, userWalletAddress } = permitRequest;
if (!userWalletAddress) {
throw new Error(logger.error(`No userWalletAddress provided for permit request: ${JSON.stringify(permitRequest)}`).logMessage.raw);
Copy link
Member

Choose a reason for hiding this comment

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

You can directly throw the logger.error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#96 (comment)

You have mentioned that before during this PR and I responded but you never replied. Idk if you had forgotten that we've spoken already or if this is you saying "regardless, these must be changed".

@@ -6,22 +6,13 @@ on:
types:
- completed

permissions: write-all

jobs:
knip-reporter:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion != 'success' }}
steps:
Copy link
Member

Choose a reason for hiding this comment

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

I think we can now replace gitcoindev/knip-reporter@main with ubiquity/knip-reporter@main

x25519privateKey: string;
}) {
if (!userWalletAddress) {
throw new Error(logger.error("ERC20 Permit generation error: Wallet not found").logMessage.raw);
Copy link
Member

Choose a reason for hiding this comment

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

Can directly throw the logger error

Copy link
Member

Choose a reason for hiding this comment

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

Stop writing error in error messages. Also use warn instead of error unless it's something we'll need to triage later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

return await tokenContract.decimals();
} catch (err) {
const errorMessage = `Failed to get token decimals for token: ${tokenAddress}, ${err}`;
logger.debug(errorMessage, { err });
Copy link
Member

Choose a reason for hiding this comment

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

You can make this a one-liner and throw the logger error (should probably not be debug)

contributionType: string;
}) {
if (!nftContractAddress) {
throw new Error(logger.error("NFT Address not found").logMessage.raw);
Copy link
Member

Choose a reason for hiding this comment

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

In this file it applies multiple time, same throw improvement can be made

nodeLinker: node-modules
Copy link
Member

Choose a reason for hiding this comment

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

I think this can be deleted since we are using bun now

Keyrxng and others added 3 commits March 12, 2025 09:08
Co-authored-by: Mentlegen <9807008+gentlementlegen@users.noreply.github.com>
Co-authored-by: Mentlegen <9807008+gentlementlegen@users.noreply.github.com>
Co-authored-by: Mentlegen <9807008+gentlementlegen@users.noreply.github.com>
@Keyrxng
Copy link
Contributor Author

Keyrxng commented Mar 12, 2025

ty for review @gentlementlegen I'll implement these changes in the next hour and hopefully this can be merged today eh?

Final word on the throw new Error vs throw logger - I've highlighted why I've kept the throw new Error a couple of times during this PR.

Is that reason being overruled and it should be updated to throw logger whatever it takes, during this PR?

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.

Convert plugin to cloudflare worker
6 participants