-
Notifications
You must be signed in to change notification settings - Fork 49
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
Vendure 2.1.1 Migration #271
Conversation
The tests seem to be failing because of this |
@dalyathan not sure if related, but FYI: https://discord.com/channels/1100672177260478564/1165075107568439326 |
Okay, I will look into it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! One thing that comes to mind: have you manually tested admin UI compilation? Should we enable that in e2e tests?
I have done it before, but it took a bit long. However, admin UI compilation is a lot faster, so we could enable compile-tests again with a testcase like this:
it.skip('Should compile admin', async () => {
fs.rmSync(path.join(__dirname, '__admin-ui'), {
recursive: true,
force: true,
});
await compileUiExtensions({
outputPath: path.join(__dirname, '__admin-ui'),
extensions: [MyparcelPlugin.ui],
}).compile?.();
const files = fs.readdirSync(path.join(__dirname, '__admin-ui/dist'));
expect(files?.length).toBeGreaterThan(0);
}, 60000);
});
I guess 60000 (1 minute) should be more than enough, if longer, throw an error?
…alue is increased to 100000
…value is increased to 200000
…ue is increased to 200000
…increased to 200000
…increased to 200000
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful util, but can you move it to packages/test
? packages/util
are utilities for usage in plugin runtime code (not-testcode).
…InAdminUiFolder method to util
@@ -65,9 +64,6 @@ export interface StripeSubscriptionPluginOptions { | |||
...(config.paymentOptions.paymentMethodEligibilityCheckers ?? []), | |||
hasStripeSubscriptionProductsPaymentChecker, | |||
]; | |||
config.apiOptions.middleware.push( | |||
createRawBodyMiddleWare('/stripe-subscription*') | |||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I missed this one. This should be there, because the request's raw body is needed to validate the incoming signature of Stripe's webhook. The e2e test don't catch this, because for testing I disabled the signature checking with
StripeSubscriptionPlugin.init({
disableWebhookSignatureChecking: true,
}),
This was disabled because I couldn't find a way to mock the signature creation properly.
I will look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stripe plugin should have the createRawBodyMiddleware. But I will look into it.
There are some issues where people are experiencing similar issues:
Actually, let me round up this PR first, because it's a big refactor of the Stripe Subscription plugin. After that I will review/edit this |
@dalyathan I have merged the latest refactored version of Stripe Subscription into this branch, so if you'd like to look at resolving this, then we can merge and publish 👌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super nice work 🦾
I re-added rawBodyMiddleware to the Picqer plugin and Sendcloud though, because they need it for the same reason as Stripe
Description
Vendure
has been updated to 2.1.1 and dependencies onapollo-server-core
has been removed. Because after adding tests for admin-ui compilation theserver.destroy()
call inafterAll
started to timeout, it has been removed.Breaking changes
Does this PR include any breaking changes we should be aware of? NO
Checklist
📌 Always:
⚡ Most of the time:
📦 For publishable packages:
package.json
to the next patch/minor/major?