Fix: IOU Request scan camera not displaying when permission first given

@neil-marcellini @deetergp @greg-schroeder
Details

This PR fixes a problem where the camera in IOURequestStepScan would not render, because the current position value provided by react-native-tab-view never updates when changing the tab.
This PR adds a patch for react-native-tab-view which forces a re-render when the tab/page changes.
Fixed Issues

$ https://github.com/Expensify/App/issues/38796
$ https://github.com/Expensify/App/issues/39285
PROPOSAL:
Tests

[x] Verify that no errors appear in the JS console

Test 1:

Create a non-scan money request to someone
Remove camera permissions
Kill and reopen app
Tap request money
Try to scan receipt
Permission prompt is shown
Choose 'Just this time'
Camera view should show

Test 2:
Prerequisite: Reset permission of the app

Go to FAB > Request Money > Scan
Verify that the camera request permission prompt doesn't appear
Click on the Continue button or capture icon
Verify that the camera request permission prompt appears
Accept the permission
Tap "Manual" tab
Close the app
Open the app
Go to FAB > Request Money
Tap Scan tab and verify the screen is NOT black
Tap Capture icon
Verify there is no error after capturing.

Offline tests

None needed.
QA Steps

[ ] Verify that no errors appear in the JS console

Same as in Tests.
PR Author Checklist

[x] I linked the correct issue in the ### Fixed Issues section above
[x] I wrote clear testing steps that cover the changes made in this PR

[x] I added steps for local testing in the Tests section
[x] I added steps for the expected offline behavior in the Offline steps section
[x] I added steps for Staging and/or Production testing in the QA steps section
[x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[x] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
[x] I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).

[x] I included screenshots or videos for tests on all platforms
[x] I ran the tests on all platforms & verified they passed on:

[x] Android: Native
[x] Android: mWeb Chrome
[x] iOS: Native
[x] iOS: mWeb Safari
[x] MacOS: Chrome / Safari
[x] MacOS: Desktop

[x] I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
[x] I followed proper code patterns (see Reviewing the code)

[x] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
[x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[x] I verified that comments were added to code that is not self explanatory
[x] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method

[x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

[x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[x] I followed the guidelines as stated in the Review Guidelines
[x] I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
[x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[x] I verified that if a function's arguments changed that all usages have also been updated correctly
[x] If any new file was added I verified that:

[x] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[x] If a new CSS style is added I verified that:

[x] A similar style doesn't already exist
[x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))

[x] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[x] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[x] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[x] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[x] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:

[x] I verified that all the inputs inside a form are aligned with each other.
[x] I added Design label and/or tagged @Expensify/design so the design team can review the changes.

[x] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[x] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native

https://github.com/Expensify/App/assets/20173411/c36d5351-36ff-4a63-b76d-1c28f92ee6b0
https://github.com/Expensify/App/assets/20173411/782a1e87-71ff-46a3-b90f-6d8bde68b000

Android: mWeb Chrome

iOS: Native

iOS: mWeb Safari

MacOS: Chrome / Safari

MacOS: Desktop

Not quite sure why I was tagged here, but I'm happy to review. The changes look good and seem to test well.

oh sorry @neil-marcellini, was meaning to tag @Julesssss, whopsii

Reviewer Checklist

[ ] I have verified the author checklist is complete (all boxes are checked off).
[ ] I verified the correct issue is linked in the ### Fixed Issues section above
[ ] I verified testing steps are clear and they cover the changes made in this PR

[ ] I verified the steps for local testing are in the Tests section
[ ] I verified the steps for Staging and/or Production testing are in the QA steps section
[ ] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[ ] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[ ] I checked that screenshots or videos are included for tests on all platforms
[ ] I included screenshots or videos for tests on all platforms
[ ] I verified tests pass on all platforms & I tested again on:

[ ] Android: Native
[ ] Android: mWeb Chrome
[ ] iOS: Native
[ ] iOS: mWeb Safari
[ ] MacOS: Chrome / Safari
[ ] MacOS: Desktop

[ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
[ ] I verified proper code patterns were followed (see Reviewing the code)

[ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[ ] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[ ] I verified that comments were added to code that is not self explanatory
[ ] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[ ] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[ ] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[ ] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
[ ] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[ ] I verified the JSDocs style guidelines (in STYLE.md) were followed

[ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[ ] I verified that this PR follows the guidelines as stated in the Review Guidelines
[ ] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
[ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[ ] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[ ] If a new component is created I verified that:

[ ] A similar component doesn't exist in the codebase
[ ] All props are defined accurately and each prop has a /** comment above it */
[ ] The file is named correctly
[ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[ ] The only data being stored in the state is data necessary for rendering and nothing else
[ ] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[ ] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[ ] All JSX used for rendering exists in the render method
[ ] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[ ] If any new file was added I verified that:

[ ] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[ ] If a new CSS style is added I verified that:

[ ] A similar style doesn't already exist
[ ] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)

[ ] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[ ] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:

[ ] I verified that all the inputs inside a form are aligned with each other.
[ ] I added Design label and/or tagged @Expensify/design so the design team can review the changes.

[ ] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[ ] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native

Android: mWeb Chrome

iOS: Native

iOS: mWeb Safari

MacOS: Chrome / Safari

MacOS: Desktop

Reviewer Checklist

[ ] I have verified the author checklist is complete (all boxes are checked off).
[ ] I verified the correct issue is linked in the ### Fixed Issues section above
[ ] I verified testing steps are clear and they cover the changes made in this PR

[ ] I verified the steps for local testing are in the Tests section
[ ] I verified the steps for Staging and/or Production testing are in the QA steps section
[ ] I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
[ ] I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)

[ ] I checked that screenshots or videos are included for tests on all platforms
[ ] I included screenshots or videos for tests on all platforms
[ ] I verified tests pass on all platforms & I tested again on:

[ ] Android: Native
[ ] Android: mWeb Chrome
[ ] iOS: Native
[ ] iOS: mWeb Safari
[ ] MacOS: Chrome / Safari
[ ] MacOS: Desktop

[ ] If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
[ ] I verified proper code patterns were followed (see Reviewing the code)

[ ] I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
[ ] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
[ ] I verified that comments were added to code that is not self explanatory
[ ] I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
[ ] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
[ ] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[ ] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
[ ] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[ ] I verified the JSDocs style guidelines (in STYLE.md) were followed

[ ] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
[ ] I verified that this PR follows the guidelines as stated in the Review Guidelines
[ ] I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
[ ] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
[ ] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
[ ] If a new component is created I verified that:

[ ] A similar component doesn't exist in the codebase
[ ] All props are defined accurately and each prop has a /** comment above it */
[ ] The file is named correctly
[ ] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
[ ] The only data being stored in the state is data necessary for rendering and nothing else
[ ] For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
[ ] Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
[ ] All JSX used for rendering exists in the render method
[ ] The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions

[ ] If any new file was added I verified that:

[ ] The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory

[ ] If a new CSS style is added I verified that:

[ ] A similar style doesn't already exist
[ ] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)

[ ] If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
[ ] If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
[ ] If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
[ ] If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
[ ] If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:

[ ] I verified that all the inputs inside a form are aligned with each other.
[ ] I added Design label and/or tagged @Expensify/design so the design team can review the changes.

[ ] If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
[ ] If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
[ ] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native

Android: mWeb Chrome

iOS: Native

iOS: mWeb Safari

MacOS: Chrome / Safari

MacOS: Desktop

@chrispader Does this PR still need a C+ review here?

@chrispader Does this PR still need a C+ review here?

@DylanDylann, yep please go ahead

Hey @chrispader, is the changes something that we might be able to get merged upstream?

@Julesssss Could you help to create an issue to handle the payment for C+ here?

Sure, lets handle it here

Hey @chrispader, is the tab-view changes something that we might be able to get merged upstream?

yes, definitely. Should we ask someone from Callstack though, since they are the maintainers of the library? My solution seems more like a hot-fix tbh. Maybe that's also not what they intended to do with the position state of the component.

Thanks I'll see what they think.

🚀 Deployed to staging by https://github.com/Julesssss in version: 1.4.62-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
failure ❌

🕸 web 🕸
success ✅

🚀 Deployed to staging by https://github.com/Julesssss in version: 1.4.62-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
failure ❌

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/thienlnam in version: 1.4.62-17 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


feat: query the gallery API until all results are fetched

Add a loop around the gallery API function to handle pagination

thanks


[BUG]: Out of sort memory in Planetscale

What version of drizzle-orm are you using?
^0.27.0
What version of drizzle-kit are you using?
^0.19.1
Describe the Bug
I am getting this error Out of sort memory in planetscale
DatabaseError: target: career-gpt.-.primary: vttablet: rpc error: code = ResourceExhausted desc = Out of sort memory, consider increasing server sort buffer size (errno 1038) (sqlstate HY001) (CallerID: t5boeqqnnq1n57esfmy5): Sql: "select id, resumeId, jobId, userId, resumeScoreId, resumeType, resumeTitle, isImported, status, resume, duplicatedFrom, isLetterSize, downloadCount, createdAt, updatedAt, cast(job as json) from (select resumes.id, resumes.resumeId, resumes.jobId, resumes.userId, resumes.resumeScoreId, resumes.resumeType, resumes.resumeTitle, resumes.isImported, resumes.status, resumes.resume, resumes.duplicatedFrom, resumes.isLetterSize, resumes.downloadCount, resumes.createdAt, resumes.updatedAt, if(count(resumes_job.jobId) = 0, '[]', json_arrayagg(json_array(resumes_job.id, resumes_job.jobId, resumes_job.userId, resumes_job.interviewId, resumes_job.index, resumes_job.resumeId, resumes_job.coverId, resumes_job.jobTitle, resumes_job.jobDescription, resumes_job.companyName, resumes_job.jobUrl, resumes_job.status, resumes_job.notes, resumes_job.logo, resumes_job.location, resumes_job.companyWebsite, resumes_job.industry, resumes_job.employeeCount, resumes_job.companyDescription, resumes_job.source, resumes_job.contactProfile, resumes_job.contactUrl, resumes_job.contactName, resumes_job.contactJobTitle, resumes_job.contactTag, resumes_job.contactCompanies, resumes_job.keywordsData, resumes_job.matchScore, resumes_job.jobMatchKeywords, resumes_job.jobMatchSkills, resumes_job.requiredJobTitle, resumes_job.requiredEducation, resumes_job.foundJobTitleInResume, resumes_job.foundEducationInResume, resumes_job.createdAt, resumes_job.updatedAt))) as job from resumes left join jobs as resumes_job on resumes.jobId = resumes_job.jobId group by resumes.id) as resumes where resumes.resumeId = :resumes_resumeId limit :vtg1", BindVars: {REDACTED}
This is the query
const resume = await db.query.resumes.findFirst({ 			where: eq(resumes.resumeId, resumeId), 			with: { 				job: true, 			}, 		});
I emailed Planetscale support and this is what they reply, as suggested we need to set sort_buffer_size, how to do it in drizzle?

The out of sort memory issue is a common one to encounter on MySQL 8.0.23, which is the version of MySQL PlanetScale's platform runs today. The issue was partially remedied in MySQL 8.0.28+ but we haven't moved our users to that version yet due to other performance related issues that have been encountered by MySQL users so we have to be cautious before we migrate our platform to the newest version.
The issue is primarily related to queries that include JSON / TEXT type columns, along with ORDER BY clauses on specific fields.
In the meantime, we have a few potential solutions/workarounds available that you can utilize.
The first suggestion would be that for the full query you received the error on whatever field you were ordering by you can add an index on that field and it will help to reduce the sort memory required and avoid the error.
The other solution we recommend would be to add in an extra SET query into your application code that increases the sort_buffer_size value from the default for the current connection/session, which you will want to set right after your connection is established so that the value is increased for any potential queries your application might run:
SET sort_buffer_size = 2097152;

Expected behavior
No response
Environment & setup
No response

@dankochetov @AlexandrLi

@dankochetov is working on this already. We should release updates for query generation in relational queries

@rhutikcodes can you give it a try with drizzle-orm@latest?

Hi @AlexBlokh I checked, its still not working :(
This is my query:
await db.query.jobs.findMany({ 			orderBy: [desc(jobs.updatedAt)], 		});
Error Logs
DatabaseError: target: prod.-.primary: vttablet: rpc error: code = ResourceExhausted desc = Out of sort memory, consider increasing server sort buffer size (errno 1038) (sqlstate HY001) (CallerID: kvbrk2p4pafwwaxocxi5): Sql: "select id, jobId, userId, interviewId, resumeId, coverId, jobTitle, jobDescription, companyName, jobUrl, status, notes, logo, location, companyWebsite, industry, employeeCount, companyDescription, source, contactProfile, contactUrl, contactName, contactJobTitle, contactTag, contactCompanies, keywordsData, matchScore, jobMatchKeywords, jobMatchSkills, requiredJobTitle, requiredEducation, foundJobTitleInResume, foundEducationInResume, createdAt, updatedAt from jobs order by jobs.updatedAt desc", BindVars: {REDACTED}     at Connection.execute (index.js:9582:13)     at async PlanetScalePreparedQuery.execute (index.js:9342:22)     at async fetchAllJobsFromDb (index.js:12445:12)     at async fetchAllUserJobs (index.js:19863:19)     at async Script.handle (index.js:21877:24)     at async Script.execute (index.js:834:15)     at async handle (index.js:413:30)     at async handle (index.js:413:30)     at async applyCors (index.js:23037:20)     at async Object.fetch (index.js:23051:33)
For now i have removed orderBy, and manually sorting it.
const jobsResponse = await db.select().from(jobs).where(eq(jobs.userId, userId));
jobsResponse.sort((a: any, b: any) => {
return new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime();});
return jobsResponse;

@AlexBlokh Hi Any updates on this?

@rhutikcodes please try recently released version - driz.li/821days

how many jobs you have in the table?

please show me raw sql query that works for your use case

Already using the latest version: "drizzle-orm": "^0.28.2"
Totals Jobs in my db: 1047
Raw SQL query that is working:
select * from jobs where userId="user_2QdcWo8QTaZ44OLhdzk5VbUcJNt";

That query does not reflect the one you’re reporting

@rhutikcodes print query that fails with ORM and pass it here, also provide a working SQL query to fetch required data from the database with orderBy
I assume there's nothing to do with ORM itself

I think we can safely close this. Seems unrelated to query generation. In any case, raw sql can always be generated with db.execute:
db.execute(sql`SET sort_buffer_size = 2097152`)

Please reopen if you think there's something that can be done on the ORM side.

I think we can safely close this. Seems unrelated to query generation. In any case, raw sql can always be generated with db.execute:
db.execute(sql`SET sort_buffer_size = 2097152`)

Please reopen if you think there's something that can be done on the ORM side.


Error: Evaluation failed: TypeError: Cannot read properties of undefined (reading 'default')

I tried all the methods in the issues but failed to solve my problem. please help me .
"whatsapp-web.js": "^1.23.0"
WhatsApp Web version: 2.3000.1011643235
Node.js version: v18.19.1

Same problem


Explode with Fortune / Misfortune buttons not updating Fortune Tracker

Describe the bug
The following buttons no longer update the Fortune Tracker automatically:

To Reproduce
Steps to reproduce the behavior:

Roll a successful attack.
Roll damage.
Click 'Explode with Fortune' or 'Explode with Misfortune'
Fortune Tracker will not update.

Expected behavior
Expected that Fortune / Misfortune will automatically update or prevent re-rolls altogether if there are no points to spend.

Fixed.


Fix compathelper

Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.68%. Comparing base (fc4d697) to head (674402f).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #138      +/-   ##
==========================================
- Coverage   93.27%   89.68%   -3.59%
==========================================
  Files          59       16      -43
  Lines        1918      834    -1084
==========================================
- Hits         1789      748    -1041
+ Misses        129       86      -43

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


Fixed the bug in calculate_r_squared in testDoctorAI

Dear Dr. Edward Choi
I created a pull request according to the https://github.com/mp2893/doctorai/issues/8,
When use_log_time set to 1, mean duration will be updated as log as well.
Best wishes
Weijie Sun

Hi Weijie,
Thanks for contribution!
Best,
Ed


[NextPluggableDevice]fix NextPluggableDevice allocator(use pjrt allocator) and Sync()

use AsyncValueAllocator if context is using PJRT runtime. And fix Sync() to call done callback to avoid hang issue in direct session.

@jyingl3  can you help to take a look? thanks

@jyingl3 I saw the PR is stuck with some internal checks Failed, if there is something need to be fixed in my PR, please let me know, thanks.

Thanks Zhoulong! Could you update tensorflow/tensorflow/core/common_runtime/next_pluggable_device/BUILD to include tensorflow/core/tfrt/common:async_value_tensor? Sorry not noticing it earlier. Thank you!

Thanks Zhoulong! Could you update tensorflow/tensorflow/core/common_runtime/next_pluggable_device/BUILD to include tensorflow/core/tfrt/common:async_value_tensor? Sorry not noticing it earlier. Thank you!

@jyingl3  done, please have a look. thanks

Hi Zhoulong, we are actively testing some TPU implementation that uses NPD to meet deadline and worry this change may cause breakage. Hope you don't mind if we withhold merging this change temporarily.

Hi Zhoulong, we are actively testing some TPU implementation that uses NPD to meet deadline and worry this change may cause breakage. Hope you don't mind if we withhold merging this change temporarily.

sure, we will wait. Thanks

Thank you Zhoulong and sorry for the delay. Could you add a new flag so that the allocator can be switched? Left a comment about that. Thank you!!


Oidc sample double renders full page

Description
As a result of Routes.razor containing both AuthorizeRouteView & RouteView the full page is rendered twice on the screen so you can scroll down to see the duplicate page:

By using only AuthorizeRouteView and removing RouteView the page is rendered only once, regardless of render mode or user authorization state.
Expected Behavior
Page is only rendered once
.NET Version
8

Fixed by #145


Package not available in Package control

I have tried installing plugin via Package control, and repository is failing.
Here is error from Sublime 2 console:
Package Control: Error downloading package. HTTP error 500 downloading https://nodeload.github.com/dzhibas/SublimePrettyJson/zip/master
Could you please provide instructions for manual install in your readme?
THanks

After 7 years, this problem repeat itself.
I need this usefully plugin, but I can't install because the program  communicate with me printed text:

Package Control: Error downloading package. HTTP error 500 downloading https://codeload.github.com/dzhibas/SublimePrettyJson/zip/master.
error: Package Control
Unable to download Pretty JSON. Please view the console for more details.


Remove remaining instances of deprecated extend

https://github.com/pricelinelabs/design-system/search?q=extend&unscoped_q=extend

I propose closing this issue since the changes were reviewed and merged.


⚠ SceneTime has degraded performance

In 1e228d0, SceneTime ($ST) experienced degraded performance:

HTTP code: 200
Response time: 1365 ms

Resolved: SceneTime performance has improved in 6af6606 after 6 minutes.


Enforces UTF-8 encoding for REST calls to resolve #1872

Signed-off-by: Christopher Grote<EMAIL_ADDRESS>

This change fixed the problem where I was using RestTemplate in my connectors, so I believe it will do the same for the core (so long as everyone is re-using this rest connector) -- however, I suspect it will be difficult to confirm without actually merging the change for people to make active use of it.
Therefore, going to go ahead and merge, but please shout at me if it causes any problems!


RuntimeError: Gocode returned empty JSON response.

Running gocode @ 3b7488f
YouCompleteMe @ 21a0019
vim-go @ fc682ce
neovim stable 0.1.2

(all are the latest as of this post)
Sporadically (but often), attempting to autocomplete an identifier will return RuntimeError: Gocode returned empty JSON response. in neovim.
The closest issue I've found is https://github.com/fatih/vim-go/issues/531 - which doesn't wholly describe the problem/fix.

Hard to tell if that's gocode fault or not. Error definitely comes from neovim, so, have no idea what it does. Maybe it simply fails to handle no autocompletion results. Or an unlikely scenario when gocode returns nothing. Gocode is pretty fault tolerant, if it panics it drops the cache and returns "PANIC" as suggestion. So, I can't imagine a case when it returns nothing.

OK: that does help debug (since I now know what to expect).
This happens often when I should have an autocompletion result—e.g. I had
suggestions for the same package/type moments before—which is why it is so
frustrating.
I suspect it is a conflict between YouCompleteMe, gocode & neovim.
On Sat, Mar 26, 2016 at 9:15 AM nsf<EMAIL_ADDRESS>wrote:

Hard to tell if that's gocode fault or not. Error definitely comes from
neovim, so, have no idea what it does. Maybe it simply fails to handle no
autocompletion results. Or an unlikely scenario when gocode returns
nothing. Gocode is pretty fault tolerant, if it panics it drops the cache
and returns "PANIC" as suggestion. So, I can't imagine a case when it
returns nothing.
—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
https://github.com/nsf/gocode/issues/340#issuecomment-201877817

This is being generated by YouCompleteMe / ycmd @ https://github.com/Valloric/ycmd/blob/6df0fe50cacb8887eda0785b845e8dc049ca0408/ycmd/completers/go/go_completer.py#L40
It appears to be generated here when Python's json.loads returns a ValueError (e.g unmarshalling error) - https://github.com/Valloric/ycmd/blob/6df0fe50cacb8887eda0785b845e8dc049ca0408/ycmd/completers/go/go_completer.py#L125-L128
The panic case is handled separately: https://github.com/Valloric/ycmd/blob/6df0fe50cacb8887eda0785b845e8dc049ca0408/ycmd/completers/go/go_completer.py#L130-L136
This is probably worth reporting in ycmd, but is there anything about gocode's JSON that might trip up the json.loads( ToUnicode( stdoutdata ) ) unmarshalling in Python?

The formatter is simple and I don't use proper json escaping, but results shouldn't really contain any special characters which require escaping: https://github.com/nsf/gocode/blob/master/formatters.go#L135-L152
Would be nice to see the output which produces invalid JSON if that's the case.

Best way to trigger that (so that I can match the RuntimeError) - turn on gocode debug mode?

Trigger what?

When RuntimeError: Gocode returned empty JSON response. is triggered by ycmd, is there a way to get the debug output from gocode to see what it was outputting?

Sadly, no. Formatting happens on the client side and debug flag only works on the server side. And messages in-between are sent using a binary format.

Okay, was looking at the ycmd issue mentioned here. It seems what gocode returns is not an "empty JSON response", but [], which is a non-empty JSON reponse, but empty JSON array and hence a valid gocode output.
Closing it as it's not a gocode bug.


Simplify code that generates and loads v2_keys

Split out of #4091
High level:
Change focus from v0_key, v1_key, and v2_key to primary key (v2_key) and legacy_keys. From here, #4091 will allow a user to use an old v2_key as a legacy_key and convert a database from using one v2_key to using another.
Low level:
Merged ez_load and ez_load_v0 (the helpers behind load_legacy_key). In the process we also pick up the ability to pass in a filename or an actual key, making it easier to test.
This PR may be easier to merge if you review by commit.

/cc @jrafanie I was attempting to make this a no brainer, so let me know if I should split further.
I was thinking that #4082 may end up looking like this:
  def v2_key
    @v2_key ||= ez_load("v2_key") || (ENV["RAILS_ENV"] != "production" && ez_load("v2_key.dev")
  end

For specs we would have:
spec/support/alt_keyroot/
  - v2_key.dev
  - (no v2_key)

@jrafanie this is passing build (not code coverage) - you ok moving forward on this one?
@Fryguy not sure if you had an opinion here

Merged #4108

Thanks for suggestion @brandondunne
MiqPassword no longer uses self.class but rather MiqPassword
This ensures that MiqPassword doesn't end up looking for @v2_key inside MiqAePassword - the MiqAePassword decryption test ensures this.

odd, the coverage errors are showing issues over in pending gems and automate. AND, that code displayed is definitely covered.

@Fryguy @jrafanie let me know if this is good, or you want me to further split

@kbrock haven't had a chance to review this yet, I'll try to get some time to take a look

I don't understand the change from self.class.v2_key to MiqPassword.v2_key.  Unless MiqAePassword overrides v2_key, it should work as is:
class SuperClass
  def self.v2_key
    @v2_key ||= "blah"
  end

  def v2_key
    self.class.v2_key
  end
end

class SubClass < SuperClass
end

SubClass.new.v2_key
#=> "blah"
SubClass.v2_key
#=> "blah"

@Fryguy then delegate:
class SuperClass
  def self.v2_key
    @v2_key ||= "blah"
  end

  delegate :v2_key, :to => :class
end

class SubClass < SuperClass
end

@Fryguy @brandondunne Yea, it is needed. The old code needed SubClass to delegate all static methods accessed via self.class.* I thought just fixing the self.class would be better than adding code to work around this.
If you want me to rollback and add delegators for the all_keys/... to MiqAePassword, I can do that. This change just seemed cleaner to me.
irb(main):026:0> class SuperClass
irb(main):027:1>   class << self
irb(main):028:2>     attr_accessor :v2_key
irb(main):029:2>   end
irb(main):030:1>
irb(main):031:1*   def encrypt
irb(main):032:2>     puts "v2_key: #{self.class.v2_key}"
irb(main):033:2>   end
irb(main):034:1> end
=> :encrypt
irb(main):035:0> class SubClass < SuperClass
irb(main):036:1> end
=> nil
irb(main):037:0> SuperClass.v2_key = "blah"
=> "blah"
irb(main):038:0> SuperClass.new.encrypt
v2_key: blah
=> nil
irb(main):039:0> SubClass.new.encrypt
v2_key:
=> nil
irb(main):040:0>

Sorry, and the case using the explicit access:
irb(main):040:0> class SuperClass
irb(main):041:1>   class << self
irb(main):042:2>     attr_accessor :v2_key
irb(main):043:2>   end
irb(main):044:1>
irb(main):045:1*   def encrypt
irb(main):046:2>     puts "v2_key: #{SuperClass.v2_key}"
irb(main):047:2>   end
irb(main):048:1> end
=> :encrypt
irb(main):049:0>
irb(main):050:0* class SubClass < SuperClass
irb(main):051:1> end
=> nil
irb(main):052:0>
irb(main):053:0* SuperClass.v2_key = "blah"
=> "blah"
irb(main):054:0>
irb(main):055:0* SubClass.new.encrypt
v2_key: blah
=> nil
irb(main):056:0>

If this v2_key delegation is the only change, I can pull this out into its own PR. Or I can roll back to code closer to the previous code.
please advise

@Fryguy @brandondunne please review

@kbrock I don't understand your examples and how they show that you need the self.class => MiqPassword change.  Can we chat?

@Fryguy Making your proposed change makes the tests fail.
I tried to show that when calling MiqAePassword#encrypt the reference to self.class.v2_key is essentially MiqAePassword.instance_variable_get(:@v2_key). And it breaks. We want MiqPassword.instance_variable_get(:@v2_key), and we can get it by either delegating MiqAePassword.v2_key to MiqPassword.v2_key or calling MiqPassword.v2_key directly.
Solutions:
A) Use before code, with class delegator.
class MiqPassword
  def encrypt
    # self.class.v2_key
  end
end
class MiqAePassword
  def self.v2_key
    MiqPassword.v2_key
  end
end

B) Use after code, that explicitly references the class.
class MiqPassword
  def encrypt
    # MiqPassword.v2_key
  end
end
class MiqAePassword
  # no delegator
end

C) remove delegator, keep self class
Tests fail.
class MiqPassword
  def encrypt
    # self.class.v2_key
  end
end
class MiqAePassword
  # no delegator
end

I don't care which one we do, I care more about the rest of this PR / the next one that actually solves the BZ. Give the word and I can roll back.

C is exactly the one I was suggesting, but you are saying it breaks, and I don't see how.

I tried to show that when calling MiqAePassword#encrypt the reference to self.class.v2_key is essentially MiqAePassword.instance_variable_get(:@v2_key)

That's not true because that's not how inheritance works with classes:
class MiqPassword
  def self.v2_key
    @v2_key ||= "blah"
  end

  def encrypt
    "#{self.class.v2_key} encrypted"
  end
end

class MiqAePassword < MiqPassword
  # no delegator
end

MiqAePassword.new.encrypt
# => "blah encrypted"

@Fryguy that ends up calling MiqAePassword.v2_key, which exists (because inherited), but accesses a different instance variable than MiqPassword.v2_key

@matthewd I see now, because the inherited method also happens to call @v2_key ||= so there's a "second" @v2_key.  So, it seems it really should be an @@ class variable / cattr_accesor

The explicit MiqPassword seems fine to me. ¯\_(ツ)_/¯

I changed to @@v2_key - good enough for me.
Does it look good now?


Audi API not working

trying to get information from myaudi.com about charging state
evcc.yaml:
vehicles:

name: audi
type: audi
title: E-Tron
capacity: 86 # kWh
user: myaudi.com useraccount
password: password
vin: WAUZZZGExxxxxxxxxxx
cache: 5m

log:
[main  ] INFO 2020/11/17 16:01:09 evcc 0.31 (feb564d)
[main  ] INFO 2020/11/17 16:01:09 using config file /root/evcc/evcc.yaml
[main  ] INFO 2020/11/17 16:01:09 listening at <IP_ADDRESS>:7070
[lp-1  ] INFO 2020/11/17 16:01:10 charger enabled
[lp-1  ] DEBUG 2020/11/17 16:01:10 set charge current: 6A
[site  ] INFO 2020/11/17 16:01:10 site config:
[site  ] INFO 2020/11/17 16:01:10   grid ✓
[site  ] INFO 2020/11/17 16:01:10   pv ✓
[site  ] INFO 2020/11/17 16:01:10   battery —
[site  ] INFO 2020/11/17 16:01:10   grid meter config:
[site  ] INFO 2020/11/17 16:01:10     power ✓
[site  ] INFO 2020/11/17 16:01:10     energy —
[site  ] INFO 2020/11/17 16:01:10     currents ✓
[lp-1  ] INFO 2020/11/17 16:01:10 loadpoint 1 config:
[lp-1  ] INFO 2020/11/17 16:01:10   vehicle —
[lp-1  ] INFO 2020/11/17 16:01:10   charge ✓
[lp-1  ] INFO 2020/11/17 16:01:10   charge meter config:
[site  ] INFO 2020/11/17 16:01:10     power ✓
[site  ] INFO 2020/11/17 16:01:10     energy —
[site  ] INFO 2020/11/17 16:01:10     currents ✓
[lp-1  ] INFO 2020/11/17 16:01:10   charger config:
[lp-1  ] INFO 2020/11/17 16:01:10     power —
[lp-1  ] INFO 2020/11/17 16:01:10     energy —
[lp-1  ] INFO 2020/11/17 16:01:10     currents —
[lp-1  ] INFO 2020/11/17 16:01:10     timer —
[lp-1  ] INFO 2020/11/17 16:01:10   mode: pv
[site  ] DEBUG 2020/11/17 16:01:10 ----
[site  ] DEBUG 2020/11/17 16:01:10 pv power: -5800W
[site  ] DEBUG 2020/11/17 16:01:10 grid power: -290W
[site  ] DEBUG 2020/11/17 16:01:10 site power: -290W
[lp-1  ] DEBUG 2020/11/17 16:01:10 charge power: 2800W
[lp-1  ] DEBUG 2020/11/17 16:01:10 charger status: C
[lp-1  ] INFO 2020/11/17 16:01:10 start charging ->
[lp-1  ] DEBUG 2020/11/17 16:01:10 detected phases: 3p [1 2 3]A
[lp-1  ] DEBUG 2020/11/17 16:01:10 max charge current: 6A = 6A + 0A (-290W @ 3p)
[lp-1  ] DEBUG 2020/11/17 16:01:10 pv timer reset
[lp-1  ] DEBUG 2020/11/17 16:01:10 target charge current: 6A
EVCC is showing "—" as vehicle and 0kWh as capacity.
Any ideas? any better log options than "debug" as shown above?
Thanks alot

Versuch bitte mal:
evcc vehicle -c <conf>

./evcc vehicle -c evcc.yaml
[main  ] INFO 2020/11/17 16:54:46 evcc 0.31 (feb564d)
[main  ] INFO 2020/11/17 16:54:46 using config file evcc.yaml
State: 76%
Charge status: A
Finish time: 2020-12-30 05:41:00 +0000 UTC
Climate active: false
Outside temp: 10.6°C
Target temp: 20.5°C
hier klappt es,
und der Fehler ist oben ersichtlich
[lp-1 ] INFO 2020/11/17 16:01:10 vehicle —
unter Loadpoint was in der Dummyconfig kein Vehicle angegeben
Vielen Dank