perf: Reduce heavy operations in Request Money flow

Details

Fixed Issues

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

Tap Global Create
Tap Request Money
Type "workspace" in search and verify it is not blocking UI while typing
Tap the workspace name
Verify you've been moved to  the next step smoothly

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

Offline tests

n/a
QA Steps

Tap Global Create
Tap Request Money
Type "workspace" in search and verify it is not blocking UI while typing
Tap the workspace name
Verify you've been moved to the next step smoothly

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

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/13985840/20ee8890-b121-4ef6-b56d-74f8862d0315

Android: mWeb Chrome
https://github.com/Expensify/App/assets/13985840/c6e9b92f-a3c2-41de-98db-43356ff3eb70

iOS: Native
https://github.com/Expensify/App/assets/13985840/e136b2fb-b1df-432d-879e-5dfb371bed8c

iOS: mWeb Safari
https://github.com/Expensify/App/assets/13985840/ad3e62f7-8c16-4f8b-a80c-4e151c762c26

MacOS: Chrome / Safari
https://github.com/Expensify/App/assets/13985840/f99dfd67-58e3-4554-9326-f5fa06a6654b

MacOS: Desktop
https://github.com/Expensify/App/assets/13985840/d955646d-989f-4775-844e-44a3f6447aba

Seeking a C+ to address this immediately

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

@TMisiukiewicz The search term "Workspac" doesn't return results, but this is happening on main as well. Is this something we want to fix here, @mountiny?
https://github.com/Expensify/App/assets/4160319/6a76472c-e2e4-4451-a4ad-6da24706bc17

@akinwale @mountiny this should be fixed once we apply the filtering from #37909 in this screen

:hand: This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

Tests were passing

🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.58-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


Pipe is a valid character in emails

There's a problem args = payload.split('|').  When email contains '|' (and yes, its valid)  it will split email address
Error:
TypeError: nothing() takes 4 positional arguments but 5 were given
I made a crude patch:
                        if phase == 'tx-mail':
                            args = payload.split('|', 2)
                        elif phase == 'tx-rcpt':
                            args = payload.split('|', 1)
                        else:
                            args = payload.split('|')

but there are others events/reports like smtp-in|protocol-client|blabla|MAIL<EMAIL_ADDRESS>P.S Thanks. I'm making a filter and this class is a great help.
P.S.2 Unnecessary, I guess, but here is my test filter:
from opensmtpd import FilterServer

def start():
    server = FilterServer()
    server.track_context()
    server.register_handler('report', 'tx-mail', nothing)
    server.serve_forever()

def nothing(session, _, result, address):
    return

if __name__ == '__main__':
    start()

What does payload look like then? Presumably, OpenSMTPd performs no escaping or the like?

Note: Pipe symbol is technically valid in email addresses but its use is discouraged.

Some MTAs will filter addresses with the pipe symbol, because it has been used in attacking email systems. Don't use it.

I guess OpenSMTPd isn’t one of those MTAs. Still quite an edge case.

I agree that it is rare and discouraged and many other things. Still... Its easy enough to manage this case instead of ignoring it:
if phase in {'link-greeting','link-tls','tx-reset','tx-begin','tx-rollback','protocol-client','protocol-server'} no split
if phase in {'link-identify','link-auth','tx-envelope','tx-data','tx-commit'} split(|,1)

etc.

I made a patch.:
        while True:
            line = self.recv()

            if (count := line.count('|')) < 5 or not line.startswith('report') or not line.startswith('filter'):
                continue

            if count == 5:
                event, version, timestamp, subsystem, phase, session = line.split('|', 5)
            else:
                event, version, timestamp, subsystem, phase, session, payload = line.split('|', 6)

            if event == 'filter':  #  filters always have a token
                token, payload = payload.split('|', 1)

            if phase in {'link-disconnect', 'timeout', 'data', 'commit'}:
                args = []
            elif phase in {'link-identify', 'link-auth', 'tx-envelope', 'tx-data', 'tx-commit'}:
                args = payload.split('|', 1)
            elif phase == 'tx-mail' and re.search(r'^0\.[1-4]$', version):
                # Older protocol versions had result and sender reversed.
                # I keep it, but does anybody use version 4 or earlier?
                a_aux = payload.split('|', 1)
                b_aux = a_aux[1].rsplit('|', 1)
                args = [a_aux[0], b_aux[1], b_aux[0]]
            elif phase in {'tx-mail', 'tx-rcpt', 'filter-report', 'filter-response'}:
                args = payload.split('|', 2)
            elif phase in {'link-connect', 'connect'}:
                args = payload.split('|', 3)
            else:
                args = [payload]

            if event == 'report':
                self._call_handlers(noop, event, phase, session, *args)
            elif phase == 'data-line':
                self._call_handlers(noop, event, phase, session, payload, send_dataline)
            else:
                self._call_handlers(send_filter_response, event, phase, session, *args)

Should be fixed with https://github.com/palant/opensmtpd-filters/commit/0504f31a97b470058cb8d872ffea76a3f26f0acf.


[0.10] Tag release images

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

Comparison is base (fab7a99) 67.48% compared to head (037707f) 67.48%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@               Coverage Diff                @@
##           release/v0.10.x    #1387   +/-   ##
================================================
  Coverage            67.48%   67.48%
================================================
  Files                  124      124
  Lines                 7477     7477
================================================
  Hits                  5046     5046
  Misses                2025     2025
  Partials               406      406

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


Fix const compile error in gcc version >= 11.2.0

Fix #1693

仍然不行，是要加什么选项吗？
-- Found gflags: /usr/lib/aarch64-linux-gnu/libgflags.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/sigma711/code/open-source-projects/incubator-brpc/build
Consolidate compiler generated dependencies of target PROTO_LIB
Consolidate compiler generated dependencies of target BUTIL_LIB
[  0%] Building C object src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/dynamic_annotations/dynamic_annotations.c.o
[  0%] Building CXX object src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/dmg_fp/dtoa_wrapper.cc.o
[  0%] Building C object src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/superfasthash/superfasthash.c.o
[  1%] Building CXX object src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/icu/icu_utf.cc.o
[  1%] Building CXX object src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/modp_b64/modp_b64.cc.o
[  2%] Building CXX object CMakeFiles/PROTO_LIB.dir/idl_options.pb.cc.o
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:26,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/src/butil/third_party/dynamic_annotations/dynamic_annotations.c:35:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/new:40,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/src/butil/lazy_instance.h:38,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/src/butil/third_party/dmg_fp/dtoa_wrapper.cc:7:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/limits:42,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/idl_options.pb.h:7,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/idl_options.pb.cc:4:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
make[2]: *** [src/CMakeFiles/BUTIL_LIB.dir/build.make:104：src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/dynamic_annotations/dynamic_annotations.c.o] 错误 1
make[2]: *** 正在等待未完成的任务....
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/string:38,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/src/butil/third_party/modp_b64/modp_b64.h:136,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/src/butil/third_party/modp_b64/modp_b64.cc:46:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from /usr/lib/gcc/aarch64-linux-gnu/9/include/stdint.h:9,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/src/butil/third_party/superfasthash/superfasthash.c:28:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/limits.h:26,
                 from /usr/lib/gcc/aarch64-linux-gnu/11/include/limits.h:203,
                 from /usr/lib/gcc/aarch64-linux-gnu/11/include/syslimits.h:7,
                 from /usr/lib/gcc/aarch64-linux-gnu/11/include/limits.h:34,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/src/butil/basictypes.h:14,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/src/butil/third_party/icu/icu_utf.h:20,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/src/butil/third_party/icu/icu_utf.cc:20:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
[  2%] Building CXX object CMakeFiles/PROTO_LIB.dir/brpc/rtmp.pb.cc.o
make[2]: *** [src/CMakeFiles/BUTIL_LIB.dir/build.make:132：src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/superfasthash/superfasthash.c.o] 错误 1
make[2]: *** [src/CMakeFiles/BUTIL_LIB.dir/build.make:118：src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/icu/icu_utf.cc.o] 错误 1
[  2%] Building CXX object CMakeFiles/PROTO_LIB.dir/brpc/rpc_dump.pb.cc.o
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/limits:42,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/rpc_dump.pb.h:7,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/rpc_dump.pb.cc:4:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/limits:42,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/rtmp.pb.h:7,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/rtmp.pb.cc:4:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
[  2%] Building CXX object CMakeFiles/PROTO_LIB.dir/brpc/get_favicon.pb.cc.o
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/limits:42,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/get_favicon.pb.h:7,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/get_favicon.pb.cc:4:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
make[2]: *** [src/CMakeFiles/BUTIL_LIB.dir/build.make:146：src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/modp_b64/modp_b64.cc.o] 错误 1
[  3%] Building CXX object CMakeFiles/PROTO_LIB.dir/brpc/span.pb.cc.o
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/limits:42,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/span.pb.h:7,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/span.pb.cc:4:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
make[2]: *** [src/CMakeFiles/BUTIL_LIB.dir/build.make:90：src/CMakeFiles/BUTIL_LIB.dir/butil/third_party/dmg_fp/dtoa_wrapper.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:239：src/CMakeFiles/BUTIL_LIB.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....
[  3%] Building CXX object CMakeFiles/PROTO_LIB.dir/brpc/builtin_service.pb.cc.o
In file included from /usr/include/features.h:486,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/aarch64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/limits:42,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/builtin_service.pb.h:7,
                 from /home/sigma711/code/open-source-projects/incubator-brpc/build/brpc/builtin_service.pb.cc:4:
/usr/include/aarch64-linux-gnu/sys/cdefs.h:314:60: error: macro "__has_attribute" requires an identifier
  314 | #if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
      |                                                            ^
make[2]: *** [CMakeFiles/PROTO_LIB.dir/build.make:262：CMakeFiles/PROTO_LIB.dir/brpc/get_favicon.pb.cc.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[2]: *** [CMakeFiles/PROTO_LIB.dir/build.make:248：CMakeFiles/PROTO_LIB.dir/brpc/rpc_dump.pb.cc.o] 错误 1
make[2]: *** [CMakeFiles/PROTO_LIB.dir/build.make:276：CMakeFiles/PROTO_LIB.dir/brpc/span.pb.cc.o] 错误 1
make[2]: *** [CMakeFiles/PROTO_LIB.dir/build.make:234：CMakeFiles/PROTO_LIB.dir/brpc/rtmp.pb.cc.o] 错误 1
make[2]: *** [CMakeFiles/PROTO_LIB.dir/build.make:220：CMakeFiles/PROTO_LIB.dir/idl_options.pb.cc.o] 错误 1
make[2]: *** [CMakeFiles/PROTO_LIB.dir/build.make:290：CMakeFiles/PROTO_LIB.dir/brpc/builtin_service.pb.cc.o] 错误 1
make[1]: *** [CMakeFiles/Makefile2:213：CMakeFiles/PROTO_LIB.dir/all] 错误 2
make: *** [Makefile:156：all] 错误 2

仍然不行，是要加什么选项吗？

我这边cmake编译是可以的。你用的是哪个commit的代码？

仍然不行，是要加什么选项吗？

我这边cmake编译是可以的。你用的是哪个commit的代码？

我用的就是主分支最新的代码。

仍然不行，是要加什么选项吗？

我这边cmake编译是可以的。你用的是哪个commit的代码？

我用的就是主分支最新的代码。

这个PR还没合入master呢

[ 52%] Building CXX object src/CMakeFiles/SOURCES_LIB.dir/bthread/task_group.cpp.o
In file included from /home/stdpain/incubator-brpc/src/butil/scoped_lock.h:30,
from /home/stdpain/incubator-brpc/src/bthread/task_group.cpp:27:
/home/stdpain/incubator-brpc/src/butil/errno.h:25: warning: "const" redefined
build passed but too many warning. Is there a better solution ?

[ 52%] Building CXX object src/CMakeFiles/SOURCES_LIB.dir/bthread/task_group.cpp.o In file included from /home/stdpain/incubator-brpc/src/butil/scoped_lock.h:30, from /home/stdpain/incubator-brpc/src/bthread/task_group.cpp:27: /home/stdpain/incubator-brpc/src/butil/errno.h:25: warning: "const" redefined
build passed but too many warning. Is there a better solution ?

This PR has fixed this warning, See: https://github.com/apache/incubator-brpc/pull/1783/files#diff-918d69093f2a6bd6fcf7e09fc4125db52992ef64d817c82f4e417579a3fabb4d


Use cuelang for configuration templating

We now use cuelang to declare product configuration in a config.cue file stored in a git repository. We also use cuelang to validate the configuration file against a schema provided by the producer.
Using cuelang permits templating of the configuration file and can address complex scenarios. We can use list comprehension to generate values, use guards to conditionally add fields and even inject values from environment.
Unfortunately at the moment we do not use cuelang on server side(mpas controllers) and we expect a yaml file with final values that will be used to mutate the kubernetes objects that will be deployed.
We propose using cuelang on server side as well in order to enable the same possibilities.
Possible Scenario
A producer provides two yaml file that are used to deploy `podinfo``
⋊> ~/c/services tree
.
├── helm_release.yaml
├── helm_repository.yaml

0 directories, 2 files

The helmRepository file content is as follow
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
  name: podinfo
  namespace: default
spec:
  type: "oci"
  interval: 1m0s
  url: oci://ghcr.io/stefanprodan/charts

Suppose that the url is under a private repository. This means that credentials need to be provided in order for the installation to succeed. At the moment it's not easy to do so, and it is a scenario that has to be supported by the provider, or we need manual intervention on the cluster to update the object and add credentials information.
We could instead convert the yamls to a cue file:
⋊> ~/c/services cue import ./... -p kube -l 'strings.ToCamel(kind)' -l metadata.name -f
⋊> ~/c/services cat helm_repository.cue

package kube

helmRepository: podinfo: {
	apiVersion: "source.toolkit.fluxcd.io/v1beta2"
	kind:       "HelmRepository"
	metadata: {
		name:      "podinfo"
		namespace: "default"
	}
	spec: {
		type:     "oci"
		interval: "1m0s"
		url:      "oci://ghcr.io/stefanprodan/charts"
	}
}

Now let's change the config.cue in order to be able to inject the credential information:
package kube

_secret ?: {
  name: string
}

_secret: name: "github-access"

helmRepository: podinfo: helmRepository.podinfo & {
  if _secret != _|_ && _secret.name != _|_ {
      secretRef: _secret.name
  }
}

We define an optional secret and add a guard to the secretRef field. It means that we add it only if there is a valid secret.Name declaration.
If we could evaluate this config file on the controller side, we could easily configure the yaml file. Let's simulate this with the cue cli:
⋊> ~/c/services cue eval -c .

helmRelease: {
    podinfo: {
        apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
        kind:       "HelmRelease"
        metadata: {
            name:      "podinfo"
            namespace: "default"
...
}
helmRepository: {
    podinfo: {
        apiVersion: "source.toolkit.fluxcd.io/v1beta2"
        kind:       "HelmRepository"
        metadata: {
            name:      "podinfo"
            namespace: "default"
        }
        secretRef: "github-access"
        spec: {
            type:     "oci"
            interval: "1m0s"
            url:      "oci://ghcr.io/stefanprodan/charts"
        }
    }
}

We can see that the helmRepository that will be deployed contains the needed secretRef. We were focusing here on a specific use case, but the proposal here is to enable using cuelang for all the configuration process on the controller side, meaning being able to mutate all kubernetes objects.

Overall I like this approach a lot but I have a few questions/comments.

We don't/can't expect users to know anything about the contents of a product with respect to Kubernetes objects. So we would still need to ensure the schema.cue file contains appropriate "mappings" to insert values.  The mappings would take the form of:

package schema

# this value is surfaced to the user
secretName?: string

# this is a private value
helmRepository: podinfo: helmRepository.podinfo & {
  if secretName != _|_  {
      secretRef:  name: secretName
  }
} @private(true)

Can we follow a similar pattern for localization? I think we can. In which case we could perhaps finally combine both into a single controller that reads a resources, a component descriptor yaml, a schema.cue, an optional config.cue.

If the answer to question two is yes then what does the resultant pipeline look like for MPAS?


Sharing sample videos in a different cloud

Hi,
Can you share the sample videos of REDS and Vid4 on Google Cloud? I tried to download them from Baidu but it required downloading the latest version of network disk client.

Nvm, I found it.


PP-1825 Upgrade local tests to Postgres 9.6.5

I've been moaning about these tests running 9.4.4 atop a container
with security issues on and off since February 2016 (see
https://payments-platform.atlassian.net/browse/PAYICE-108)
On top of that, real environments have been running postgresql 9.6.x
since March 2017 so this is doubly annoying.
(https://github.com/alphagov/pay-infra/commit/1ae9e2a08bb4789728d49b192d513ecede81c713)

rebuild

Closing, this uncovered bigger issues with how the container this depends on, what's in version control vs Docker hub and developer laptops v CI vs production.


[Service Bus] Support duration in the Application Props - CorrelationFilter for interop

[Since this is a non-breaking change, deferring it to post GA.]
This marks the final PR for https://github.com/Azure/azure-sdk-for-js/issues/9850
(The only thing that's left for #9850 is to do the testing that our rules set using the ATOM API work fine with the messages sent from the AMQP clients/senders, but that's more like.. testing the service at this poiint.)
For this PR,

[x] Removing the unused AMQP rule management methods under $managementLink
[x] Support Duration
[x] Add positive tests
[x] Add failure tests
[x] Changelog

/azp run js - servicebus - tests

Since this is a non-breaking change, deferring it to post GA.

Moving to a branch and closing this PR as suggested by @ramya-rao-a
https://github.com/Azure/azure-sdk-for-js/tree/harshan/sb%2Fissue-9850%2Ffilter-interop


haskellPackages.hakyll: bump pandoc dependency to 2.7

Motivation for this change
Hakyll build broke when pandoc moved to 2.7.
Things done
Hakyll seems to build with Pandoc 2.7 just fine, so I adapted it's version bounds. For some reason, doJailbreak did not work, so I created a patch.
As I have no access to a darwin machine, I only changed the non-darwin part of the expression.
See also this issue, which reports the issue upstream: https://github.com/jaspervdj/hakyll/pull/691

[X] Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
Built on platform(s)

[X] NixOS
[ ] macOS
[ ] other Linux distributions

[ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
[ ] Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
[ ] Tested execution of all binary files (usually in ./result/bin/)
[ ] Determined the impact on package closure size (by running nix path-info -S before and after)
[ ] Assured whether relevant documentation is up to date
[ ] Fits CONTRIBUTING.md.

@GrahamcOfBorg build haskellPackages.hakyll

@GrahamcOfBorg build haskellPackages.hakyll

FYI: doJailbreak doesn't work if dependencies are behind flags.

FYI: doJailbreak doesn't work if dependencies are behind flags.

I see, thanks for the explanation!


This is gold ! thank you for doing this, except the YAML part though.

I made my own contraption to do the same thing same table, but multiple types, I am using graphql, so the typescript classes are part of the entire app.
Is there a technical limitation why you went with the yaml model generation ? instead of typescript decorators ?
Again thank you so much for this

Hey there,

Is there a technical limitation why you went with the yaml model generation ? instead of typescript decorators ?

Yes and no.
Beyonce code-generates a few things beyond just model objects (e.g. objects for your partitions, a tagged union of all your models etc) - so there's more required than just a TS interface/class per model. That being said, there's not a technical limitation as to why you couldn't define your models in TypeScript and have the code-generator use those definitions. That's significantly more involved though and requires hooking into the TS compiler to get the AST.
Also fwiw, I'm personally not a fan of using decorators/annotations in code and thus Beyonce's design reflects those preferences.
I think the ideal here would be to not need code-generation at all and just be able to write normal TypeScript (sans decorators). The generated code is currently fairly-short, but it's still significantly less verbose to defines things in YAML...at least as they are now.

Again thank you so much for this

Glad you like the project.
One thing to be aware of is this library is  nascent and thus the current API doesn't offer the full range of DynamoDB features (it's tuned for Ginger's current use-cases). And there might be breaking API changes in the future.

I see your point, I actually ended up running the codegen couple of times after that i had an idea on how to write the models myself.
I can see the use for the YAML though, I used to do the same, because I needed types for both javascript and python, and YAML was handy and less cluttered.
Here is the type of classes I am using to make the models,  generate the graphql schema and so on:
@ObjectType({ description: "User device for mobile, tablette or web" })
export class Device {
    model: ModelType.Device

    @Field(type => ID)
    id: string;

    @Field()
    userId: string;

    @Field()
    token: string;

    @Field()
    platform: string;

    @Field()
    active:boolean;

    @Field()
    uuid: string

    @Field(type => Int)
    createdAt: number;
}

Much appreciate your effort guys open sourcing this, I'll be more than happy to help out, and make PRs when needed.

PRs would certainly welcome and appreciated!
In particular, Beyonce currently doesn't support the full range of DynamoDB operations (e.g. missing update, delete...), comparison operators (e.g. begins_with, contains, size...), and expressions (e.g. conditional expressions). So those would be great areas for improvement.
Re: graphQL schema generation from the Dynamo model definitions, it's certainly a valid use-case, although it's out of scope for Beyonce. It'd make a great add-on / supporting library though. The main reason why I say this is that database libraries imo shouldn't make assumptions about the structure of your API.


Prisma migration error when attempting to use postgresql

Hello,

I've uncommented the postgresql option in server/prisma/schema.prisma and commented-out the sqlite option.
I've set the DATABASE_URL env variable and I can see in the logs that the app is able to auth to the postgresql database.
The issue I'm having is that the prisma migrations are failing.

Are these sqlite-specific? or is there something else I should focus on to get this working?

ERROR:
2024-08-14T04:41:56.4527110Z Environment variables loaded from .env
2024-08-14T04:41:56.4709076Z Prisma schema loaded from prisma/schema.prisma
2024-08-14T04:42:07.0389528Z
2024-08-14T04:42:07.0390667Z ✔ Generated Prisma Client (v5.3.1) to ./node_modules/@prisma/client in 5.37s
2024-08-14T04:42:07.0390836Z
2024-08-14T04:42:07.0390880Z Start using Prisma Client in Node.js (See: https://pris.ly/d/client)
2024-08-14T04:42:07.0390919Z ```
2024-08-14T04:42:07.0390957Z import { PrismaClient } from '@prisma/client'
2024-08-14T04:42:07.0390996Z const prisma = new PrismaClient()
2024-08-14T04:42:07.0391032Z ```
2024-08-14T04:42:07.0391101Z or start using Prisma Client at the edge (See: https://pris.ly/d/accelerate)
2024-08-14T04:42:07.0391137Z ```
2024-08-14T04:42:07.0391174Z import { PrismaClient } from '@prisma/client/edge'
2024-08-14T04:42:07.0391212Z const prisma = new PrismaClient()
2024-08-14T04:42:07.0391245Z ```
2024-08-14T04:42:07.0391307Z
2024-08-14T04:42:07.0391346Z See other ways of importing Prisma Client: http://pris.ly/d/importing-client
2024-08-14T04:42:07.0391379Z
2024-08-14T04:42:22.3401693Z Environment variables loaded from .env
2024-08-14T04:42:22.3483526Z Prisma schema loaded from prisma/schema.prisma
2024-08-14T04:42:22.4544716Z Datasource "db": PostgreSQL database "redacted", schema "public" at "redacted.com:5432"
2024-08-14T04:42:24.0652199Z
2024-08-14T04:42:24.0664917Z 21 migrations found in prisma/migrations
2024-08-14T04:42:24.0723843Z
2024-08-14T04:42:24.9086284Z Error: P3009
2024-08-14T04:42:24.9090144Z
2024-08-14T04:42:24.9090438Z migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
2024-08-14T04:42:24.9090488Z The `20230921191814_init` migration started at 2024-08-14 03:53:15.193764 UTC failed

Thank you

Keep in mind we dont support using PG as the backend because of these issues
So it seems to fail on https://github.com/Mintplex-Labs/anything-llm/blob/master/server/prisma/migrations/20230921191814_init/migration.sql
This can lead to several issues because we use SQLITE AUTOINCREMENT is not valid in PG, you need to use SERIAL. Basically, you need to generate a custom PG schema migration set if you want to swap to PG because of these subtle differences.
If you swap the connector in schema.prisma and in the server delete the entire migration folder and then run yarn primsa:migrate it should regen the entire DB schema migration set to be valid in PG.
Again, this is not something we explicitly support so this ultimately falls on you for bug fixes, but that is where i would start.

Thank you.
Testing the suggestion now:

Remove migrations directory
Add yard prisma:migrate to the Dockerfile
Build Docker from forked repo
🤞

Hm...I'm not quite sure which context to run the yarn primsa:migrate command in the Dockerfile.
Like this?
...
# After copying the server code and setting up the environment
COPY ./server /app/server/
WORKDIR /app/server
RUN yarn install --production --network-timeout 100000 && yarn cache clean

# Is `/app` the "root directory" or is `/app/server`?

WORKDIR /app
RUN yarn prisma:migrate

# Continue with the rest of the Dockerfile
WORKDIR /app

# Setup the environment
ENV NODE_ENV=production
ENV ANYTHING_LLM_RUNTIME=docker
...

For this dockerfile
WORKDIR /app/server
RUN yarn prisma:migrate

Man! I cannot figure out how to get the DATABASE_URL (from prism.schema) into the GitHub Workflow that executes the Dockerfile build and push.
I tried saving it as a GitHub Action Secret then calling it different ways in both the Workflow and the Dockerfile...Ugh!
Keep getting something along the lines of:
#23 1.185 Environment variables loaded from .env
#23 1.186 Prisma schema loaded from prisma/schema.prisma
#23 1.200 Datasource "db": PostgreSQL database
#23 1.207
#23 1.208 Error: Prisma schema validation - (get-config wasm)
#23 1.208 Error code: P1012
#23 1.208 error: Error validating datasource `db`: You must provide a nonempty URL. The environment variable `DATABASE_URL` resolved to an empty string.
#23 1.208   -->  schema.prisma:11
#23 1.208    |
#23 1.208 10 |   provider = "postgresql"
#23 1.208 11 |   url      = env("DATABASE_URL")
#23 1.208    |
#23 1.208
#23 1.208 Validation Error Count: 1
#23 1.208 [Context: getConfig]
#23 1.208
#23 1.208 Prisma CLI Version : 5.3.1
#23 1.238 error Command failed with exit code 1.

Current Workflow:
name: Linux_Container_Workflow
on:
  workflow_dispatch:
jobs:
    build-and-deploy:
        runs-on: ubuntu-latest
        steps:

        - name: 'Checkout GitHub Action'
          uses: actions/checkout@v3

        - name: 'Login via Azure CLI'
          uses: azure/login@v1
          with:
            creds: ${{ secrets.AZURE_CREDENTIALS }}

        - name: 'Build and push image'
          uses: azure/docker-login@v1
          with:
              login-server: ${{ secrets.REGISTRY_LOGIN_SERVER }}
              username: ${{ secrets.REGISTRY_USERNAME }}
              password: ${{ secrets.REGISTRY_PASSWORD }}
              build-args: DATABASE_URL=${{ secrets.DATABASE_URL }}

        - run: |
            docker build -f docker/Dockerfile -t ${{ secrets.REGISTRY_LOGIN_SERVER }}/anythingllm_custom:${{ github.sha }} .
            docker push ${{ secrets.REGISTRY_LOGIN_SERVER }}/anythingllm_custom:${{ github.sha }}

        - name: 'Deploy to Azure Web App'
          uses: azure/webapps-deploy@v2
          with:
              app-name: 'amg-secure-chat-dev'
              images: ${{ secrets.REGISTRY_LOGIN_SERVER }}/anythingllm_custom:${{ github.sha }}

Current Dockerfile:
# Setup base image
FROM ubuntu:jammy-20240627.1 AS base

# Build arguments
ARG ARG_UID=1000
ARG ARG_GID=1000
ARG DATABASE_URL
ENV DATABASE_URL=${DATABASE_URL}

FROM base AS build-arm64
RUN echo "Preparing build of AnythingLLM image for arm64 architecture"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install system dependencies
# hadolint ignore=DL3008,DL3013
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
        unzip curl gnupg libgfortran5 libgbm1 tzdata netcat \
        libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 \
        libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 \
        libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 \
        libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release \
        xdg-utils git build-essential ffmpeg && \
    mkdir -p /etc/apt/keyrings && \
    curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
    echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
    apt-get update && \
    apt-get install -yq --no-install-recommends nodejs && \
    curl -LO https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn_1.22.19_all.deb \
        && dpkg -i yarn_1.22.19_all.deb \
        && rm yarn_1.22.19_all.deb && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Create a group and user with specific UID and GID
RUN groupadd -g "$ARG_GID" anythingllm && \
    useradd -l -u "$ARG_UID" -m -d /app -s /bin/bash -g anythingllm anythingllm && \
    mkdir -p /app/frontend/ /app/server/ /app/collector/ && chown -R anythingllm:anythingllm /app

# Copy docker helper scripts
COPY ./docker/docker-entrypoint.sh /usr/local/bin/
COPY ./docker/docker-healthcheck.sh /usr/local/bin/
COPY --chown=anythingllm:anythingllm ./docker/.env.example /app/server/.env

# Ensure the scripts are executable
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
    chmod +x /usr/local/bin/docker-healthcheck.sh

USER anythingllm
WORKDIR /app

# Puppeteer does not ship with an ARM86 compatible build for Chromium
# so web-scraping would be broken in arm docker containers unless we patch it
# by manually installing a compatible chromedriver.
RUN echo "Need to patch Puppeteer x Chromium support for ARM86 - installing dep!" && \
    curl https://playwright.azureedge.net/builds/chromium/1088/chromium-linux-arm64.zip -o chrome-linux.zip && \
    unzip chrome-linux.zip && \
    rm -rf chrome-linux.zip

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV CHROME_PATH=/app/chrome-linux/chrome
ENV PUPPETEER_EXECUTABLE_PATH=/app/chrome-linux/chrome

RUN echo "Done running arm64 specific installation steps"

#############################################

# amd64-specific stage
FROM base AS build-amd64
RUN echo "Preparing build of AnythingLLM image for non-ARM architecture"

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Install system dependencies
# hadolint ignore=DL3008,DL3013
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
        curl gnupg libgfortran5 libgbm1 tzdata netcat \
        libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 \
        libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libx11-6 libx11-xcb1 libxcb1 \
        libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 \
        libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release \
        xdg-utils git build-essential ffmpeg && \
    mkdir -p /etc/apt/keyrings && \
    curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
    echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
    apt-get update && \
    apt-get install -yq --no-install-recommends nodejs && \
    curl -LO https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn_1.22.19_all.deb \
        && dpkg -i yarn_1.22.19_all.deb \
        && rm yarn_1.22.19_all.deb && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Create a group and user with specific UID and GID
RUN groupadd -g "$ARG_GID" anythingllm && \
    useradd -l -u "$ARG_UID" -m -d /app -s /bin/bash -g anythingllm anythingllm && \
    mkdir -p /app/frontend/ /app/server/ /app/collector/ && chown -R anythingllm:anythingllm /app

# Copy docker helper scripts
COPY ./docker/docker-entrypoint.sh /usr/local/bin/
COPY ./docker/docker-healthcheck.sh /usr/local/bin/
COPY --chown=anythingllm:anythingllm ./docker/.env.example /app/server/.env

# Ensure the scripts are executable
RUN chmod +x /usr/local/bin/docker-entrypoint.sh && \
    chmod +x /usr/local/bin/docker-healthcheck.sh

#############################################
# COMMON BUILD FLOW FOR ALL ARCHS
#############################################

# hadolint ignore=DL3006
FROM build-${TARGETARCH} AS build
RUN echo "Running common build flow of AnythingLLM image for all architectures"

USER anythingllm
WORKDIR /app

# Install & Build frontend layer
FROM build AS frontend-build
COPY --chown=anythingllm:anythingllm ./frontend /app/frontend/
WORKDIR /app/frontend
RUN yarn install --network-timeout 100000 && yarn cache clean
RUN yarn build && \
    cp -r dist /tmp/frontend-build && \
    rm -rf * && \
    cp -r /tmp/frontend-build dist && \
    rm -rf /tmp/frontend-build
WORKDIR /app

# Install server layer & build node-llama-cpp
# Also pull and build collector deps (chromium issues prevent bad bindings)
FROM build AS backend-build
COPY ./server /app/server/
WORKDIR /app/server
RUN yarn install --production --network-timeout 100000 && yarn cache clean

# Write DATABASE_URL to .env
ARG DATABASE_URL
RUN sh -c 'echo DATABASE_URL=$DATABASE_URL > .env'
RUN yarn prisma migrate deploy

WORKDIR /app

# Install collector dependencies
COPY ./collector/ ./collector/
WORKDIR /app/collector
ENV PUPPETEER_DOWNLOAD_BASE_URL=https://storage.googleapis.com/chrome-for-testing-public
RUN yarn install --production --network-timeout 100000 && yarn cache clean

# Compile Llama.cpp bindings for node-llama-cpp for this operating system.
# Creates appropriate bindings for the OS
USER root
WORKDIR /app/server
RUN npx --no node-llama-cpp download
WORKDIR /app
USER anythingllm

# Since we are building from backend-build we just need to move built frontend into server/public
FROM backend-build AS production-build
WORKDIR /app
COPY --chown=anythingllm:anythingllm --from=frontend-build /app/frontend/dist /app/server/public
USER root
RUN chown -R anythingllm:anythingllm /app/server && \
    chown -R anythingllm:anythingllm /app/collector
USER anythingllm

# No longer needed? (deprecated)
# WORKDIR /app/server
# RUN npx prisma generate --schema=./prisma/schema.prisma && \
#     npx prisma migrate deploy --schema=./prisma/schema.prisma
# WORKDIR /app

# Setup the environment
ENV NODE_ENV=production
ENV ANYTHING_LLM_RUNTIME=docker

# Setup the healthcheck
HEALTHCHECK --interval=1m --timeout=10s --start-period=1m \
  CMD /bin/bash /usr/local/bin/docker-healthcheck.sh || exit 1

# Run the server
# CMD ["sh", "-c", "tail -f /dev/null"] # For development: keep container open
ENTRYPOINT ["/bin/bash", "/usr/local/bin/docker-entrypoint.sh"]

Just to align on what is setup here:

You have a PG database running on Azure cloud connected via some connection string
You also are using Azure Blob Storage Container as basically persistent storage instance of storing or doing I/O on the container ephemeral storage?

PostgreSQL database:

Yes. Running Azure Database for PostgreSQL.
Passing a DATABASE_URL (connection string) as an environment variable during the GitHub Action build.
This env var is consumed by server/prisma/schema.prisma.// Uncomment the following lines and comment out the SQLite datasource block above to use PostgreSQL
// Make sure to set the correct DATABASE_URL in your .env file

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

This is partially working (the _prisma_migrations table was autocreated, but thats the only table created)

App Storage (assets, comkey, etc.):

This is done by mounting /app/server/storage to a SMB Azure Blob File Share in the Web App itself
This is currently working (the comkeys have been created)

LanceDB vector store:

Stored in an Azure Blob Container by editing the server/utils/vectorDbProviders/lance/index.js as described here.
This is currently not working.

LanceDB vector store:

For what its worth, the reason that probably does not work is the the az:// protocol is not recognized by LanceDB itself, not that the system does not recognize it. Since you already have /app/server/storage mounted you can actually just keep LanceDB's file the exact same.
https://github.com/Mintplex-Labs/anything-llm/blob/a8d25c7dd31e90b06c9ea8575ada2321928dcfa4/server/utils/vectorDbProviders/lance/index.js#L15
Will save to /app/server/storage/lancedb since STORAGE_DIR is likely set as an env as well. If not, it should also be /app/server/storage


feat(input): add custom error state matcher

Fixes https://github.com/angular/material2/issues/4232
cc @mmalerba

I'm wondering if this should be a more generally configurable concept; <md-select> will really need the same thing.

@kara should also weigh in as this touches on forms

@jelbourn agreed on making it more general. #4672 (or at least #2498) would help

@jelbourn since you last reviewed, I've made the following changes:

errorStateMatcher is a property on the input rather than the container (not ideal for reusability but necessary since https://github.com/angular/material2/pull/4757)
A global error state matcher can be provided via MD_ERROR_GLOBAL_OPTIONS
Can also configure all inputs to show errors when dirty instead of touched via MD_ERROR_GLOBAL_OPTIONS (since this seems to be a more common request https://github.com/angular/material2/issues/4232#issue-223812627, https://github.com/angular/material2/issues/2965#issuecomment-278975641)

I'm far from married to # 3, but wanted to explore other global options. Also if this isn't the right approach, that's fine, but I'd like to keep the conversation moving.

@mmalerba I've addressed your comments! Please advise if I misinterpreted any of your class implementation suggestions.

@mmalerba done!
The convenience function showOnDirtyErrorStateMatcher will show errors when,
isInvalid && (isDirty || isSubmitted)

But I'm curious if the expected behavior might be,
isInvalid && (isDirty || isTouched || isSubmitted)

@kara comments addressed. Could you take another look?

LGTM, waiting on @mmalerba to do a last pass.


[docs] Update README with destinations gtm

#558  👈 (View in Graphite)
main

This stack of pull requests is managed by Graphite. Learn more about stacking.


gzip compression

gzip compression

This issue was imported from Google Moderator
Moderator votes: +10
Issue added by Zeke on 2014-08-24
To vote this issue up or down, simply include +1 or -1 in your comment.

+1

-1
Seems unnecessary in 2015

@Ugoku I kind of agree, but would imagine a lot of people need to look that fact up. And normally I go to caniuse for looking up compatibility. Maybe there's a way of adding a low-maintenance "don't worry about it, gzip support is practically universal" page?

Okay, now I'm genuinely curious :) why do you need compatibility info on gzip? Like you said, don't worry about it, support is practically universal. gzip compatibility for me falls in the realm of inline-block compatibility.
If a low-maintenance solution is possible for things that have been around forever, I would be all in favour of that.

:D No good reason other than reference, I suppose. gzip compatibility, like the ubiquity of inline-block support, can be considered common knowledge for front-end devs, but might not be common knowledge for everyone.
E.g. those new to web development will still find a lot of outdated compatibility warnings on the web, and are used to checking caniuse.com as an up-to-date reference.
I should add that I have no idea how many of these once-unsupported-now-standard cases there might be out there.

Hm yeah, when you put it like that, it makes sense to include it.
Like you said though, there are many cases where you could argue the same. Should !important (#1388) be on there? (Not asking you specifically, but in general)
I guess the only person to properly answer that question is @Fyrd

There's some things that indeed have been supported since forever (like in IE6, Firefox 2, Chrome 1, etc) that aren't worth having tables for. Instead I have a file I put some basic info for these that shows up on search so people know they can safely use it. At some point I'll go through all these issues and look for such requests so I can include them there.

+1

I agree with ludwigschubert

+1

+1

+1 on "yes, everywhere" tables

+1 on yes too ;-)

this should be qualified that it is for server responses.   browsers might support gzip on requests as well.

Now available as search result at http://caniuse.com/#search=gzip compression


[TASK] Add note about typo3-uploader-ter action

Closes #31

Failed to rebase properly.. will add a new PR


Hilt integration

Great plugin you got there! I have one issue - in new project, based directly on Hilt, the Dagger window is empty:

I don't see any errors,  projects build and runs just fine.
Tried on Android Studio 4.0.1 with Hilt 2.28.3-alpha

The plugin works based on the Dagger-Spi plugin. If Hilt is not supported, then I believe Hilt is doing something else, probably byte code manipulation. Our original goal was not for Android projects, but rather non-android projects that uses Dagger.
Also, seems Android Studio now has support for Dagger (navigation). Is Hilt supported as part of that?
So to support Hilt, I believe we need to change the underlying implementation, may be just for projects that uses Hilt. I will try using Hilt and see what the generated code looks like, and why Dagger Spi is not fetching the graph 🤔

Dagger will be supported in Android Studio 4.1 (in RC now) and Hilt will be supported in Android Studio 4.2 (Canary). But as i understand - this support will be for navigation only. Your plugin is better for a top-down overview of the whole graph


GitReleaseManager.yml isn't being used

Looks like my GitReleaseManager.yml isn't being used. When I added it, I wasn't sure if it would be loaded automatically by convention, or if I needed to explicitly reference it. Looks like it's the latter.

@dracan fairly sure that GRM is looking for GitReleaseManager.yaml not GitReleaseManager.yml.  It should probably be updated to look for both.

@gep13 Ah, that makes sense. I wasn't sure if it should be loaded automagically, or if needed to be explicitly referenced anyway. I noticed when publishing this morning that it failed due to my refactor label on an issue which is covered in my GitReleaseManager yaml file - so I just created this ticket without looking further into it. So should it by design just look in the current folder for the file and just magically work? Ie. the filename extension is most likely the issue I'm experiencing?

Yes, GRM will automagically pick up the YAML file, but it does expect it to be named specifically, and I am fairly sure that is the problem that you are running into.

Yeah, looks like it is specific:
https://github.com/GitTools/GitReleaseManager/blob/1923bd87b4c9caee2e884e65281056d02d6210f3/Source/GitReleaseManager/Configuration/ConfigurationProvider.cs#L76

Cool - renamed it then :) Thanks for the spot!


fix(motion_planning): fix processing time debug type and topic name

Description
Fix the debug time type and topic name of the diagnostic processing time broadcasting.
Related links
Parent Issue:

Link

How was this PR tested?
PSim.
Notes for reviewers
None.
Interface changes
Topic changes
Modifications

Version
Topic Type
Topic Name
Message Type
Description

Old
Publication
~/motion_velocity_planner/debug/processing_time_ms
diagnostic_msgs/DiagnosticStatus
Topic description

New
Publication
~/motion_velocity_planner/debug/total_time/processing_time_ms_diag
diagnostic_msgs/DiagnosticStatus
Topic description

As in other planning nodes, processing_time_ms should be tier4_debug_msgs/floatXXStamped, while processing_time_diag should be diagnostic_msgs/DiagnosticStatus. This PR fixes the incoherence in the original code.
Effects on system behavior
None.

@Owen-Liuyuxuan thank you very much for this PR!
@maxime-clem
I am curious about the "total_time/" part of the topic names for both the tier4_debug_msgs/floatXXStamped and the diagnostic_msgs/DiagnosticStatus publishers, the "total_time/" part does not seem to be standard on other modules (example https://github.com/tier4/autoware.universe/blob/04de7d5602b64511030007939307c8bce55c58f5/perception/euclidean_cluster/src/euclidean_cluster_node.cpp#L81). Shouldn't it be removed and the topics be ~/motion_velocity_planner/debug/processing_time_ms_diag & ~/motion_velocity_planner/debug/processing_time_ms ?

@maxime-clem
So I believe this PR can be closed and we pick https://github.com/autowarefoundation/autoware.universe/pull/7885 instead


Connection Dialog defaults to Kusto Connection

Azure Data Studio Version: 1.26.0

Steps to Reproduce:

Open Connection Dialog to make a new connections.

Expected - Default Connection is Microsoft SQL Server
Actual - Default Connection is Azure Data Explorer (Kusto)

Closing as duplicate of https://github.com/microsoft/azuredatastudio/issues/13930

Closing as duplicate of https://github.com/microsoft/azuredatastudio/issues/13930


[NDF] Fix NDF in etag tests: downloading files just uploaded

PULL REQUEST
Overview
Example test failure: https://github.com/SkynetLabs/skynet-js/pull/298/checks?check_run_id=3693225837

Merging as it's a minor change and this should decrease the amount of CI failures.


Updated SQLDumper.php

I've used your library and it worked well. Just it needs to be compatible with UTF-8 encoding. I have added this feature at the line 76.
I hope it can be a useful update on your package.

Probably a good idea to add that, but you added a new file at the root, instead of modifying the file in src/SQLDumper.php

Probably a good idea to add that, but you added a new file at the root, instead of modifying the file in src/SQLDumper.php

You are right. It was my mistake.
If you want I will add the file to the correct path, otherwise you may do it.
Acutually it is my first contribute on a project in Github. Sorry for the mistake.
To inform you, I have tested the applied edit and it worked well.

This is old but you never updated your pull request so I'm closing this now. I've fixed this issue now

@Y0lk Thank you for your fixation. I forgot about updating this issue and pull request.


Zoom aspect ratio changes when adding image of the same size as of the demo car images

The image is the demo image of size 400x400.
The second image is of the same size 400x400, but there is something wrong.

I cant  think of anything which might create this problem. Both the images have same resolution and pixels/inch still the library affects both the image differently.

Check this example: https://payalord.github.io/xzoom-sandbox/DifferentImageSizes/ (available in sandbox)
Make sure you use proper images for preview and original. Original image must be higher by resolution than preview. While preview image higher by resolution than thumbnail image.

Ohh yes, The demo images are coming from different folders: Original & 'Preview'.


remove all django views and redirect from / to /agenda/

The django views will be removed with #1539. The redirect is still open

We now have a home view. So the redirect is not needed anymore


Custom setter/getter support

Is custom setter/getter for defaults currently supported?
I saw in #154 that it was initially planned but I don't see it in the docs.

Hey @StevenMagdy! Yes, we introduced custom getters/setters with the introduction of bridges in version 4.0.
See the Custom Types section in the Readme to find out how to create your custom bridge.
Also, let me know if you have any troubles with that :)

Thanks for the quick reply :)
I have an array of a Codable struct in UserDefaults that I want to filter before saving in SwiftyUserDefaults
what I understood should be done do is:
final class DefaultsCountryArrayBridge: DefaultsBridge<[Country]> {
  override func save(key: String, value: [Country]?, userDefaults: UserDefaults) {
    guard let value = value?.filter({ $0.id > 0 }),
      let data = try? JSONEncoder().encode(value) else {
      userDefaults.removeObject(forKey: key)
      return
    }
    // userDefaults.set(encodable: values, forKey: key) is not accessible
    userDefaults.set(data, forKey: key)
  }

  override func get(key: String, userDefaults: UserDefaults) -> [Country]? {
    guard let data = userDefaults.data(forKey: key) else { return nil }
    return deserialize(data)
  }

  override func isSerialized() -> Bool {
    return true
  }

  override func deserialize(_ object: Any) -> [Country]? {
    guard let data = object as? Data else { return nil }
    return try? JSONDecoder().decode([Country].self, from: data)
  }
}

extension Country: DefaultsSerializable {
  static var _defaults: DefaultsBridge<Country> { return DefaultsCodableBridge() }
  static var _defaultsArray: DefaultsBridge<[Country]> { return DefaultsCountryArrayBridge() }
}

but i feel (and hope) it should be simpler than this, shouldn't it be a simple clousure that would be called before saving ?

@StevenMagdy yeah, you should be able to inherit from DefaultsCodableBridge and just override save func with the filtering and then calling super.save... when you filtered out the values.


Which role should the service account have?

Cloud Datastore User, perhaps? :)

It should be Storage Admin Role.

Please comment on this issue again if you have any further questions and I'll reopen.


move CI reqs to CI config

This PR fixes the CI build problem due to tidy installation problem
How to test:

[ ] look at travis checks

Expected test outcome:

[ ] check that all checks are green
[ ] Take a screenshot and attach or copy/paste the output.

Review:

[ ] code approved by
[ ] tests executed by
[ ] "Merge and deploy" approved by
Thanks for filling in who performed the code review and the test!

This version is a:

[ ] MAJOR - when you make incompatible API changes
[ ] MINOR - when you add functionality in a backwards compatible manner
[x] PATCH - when you make backwards compatible bug fixes or documentation/instructions

As soon as it passes the tests! ;)

Ok, I don't have time to fix this, I think it was an already existing problem, closing


Factor out painting logic for DecorationImage

This avoids some code duplication that existed before and will make
further modifications easier.
Also fixes a bug where ShapeDecoration was messing up RTL logic. Added a test for that.

@abarth this'll make https://github.com/flutter/flutter/issues/12452 easy


Is there a way to delete states by identifier?

The state names in the storage folder are encrypted, as well as the contents. I wonder if it is possible to delete a given state by providing the state string? Something like nb delete state123

Hi! Not through the command line, but what you can do is get details about the state:
nb - ABC state

It will return something like:
{:state=>
  {:path=>
    "/home/user/.local/state/nano-bots/ruby-nano-bots/none/unknown/0-0-0/XPTO/state.json",
   :content=>
    {:key=>"ABC",
     :history=>
      [{:at=>"2024-06-04 17:05:58 -0300", :who=>"user", :mode=>"eval", :input=>"hi", :message=>"hi"},
       {:who=>"AI", :message=>"Hello! How can I assist you today?", :mode=>"eval", :output=>"Hello! How can I assist you today?\n", :at=>"2024-06-04 17:06:01 -0300"}]}}}

Then you can delete the file:
/home/user/.local/state/nano-bots/ruby-nano-bots/none/unknown/0-0-0/XPTO/state.json

Perfect, thank you very much! This works for my cause. I didn't see the debugging part in the readme (mostly because I was searching for 'delete' or 'state').
The only thing that bothers me: Debugging a non-existing state will create it. So if I want to check if a state with a given name exists, I will always create it, and therefore it will exists. Is this intended behaviour? Seems like debugging a non-existing state should throw an error.

@rcheetah  Yeah, you would need to check the state file, and if it's empty (history array empty), it means it "doesn't exist." This wasn't intentionally built that way. The reason it happens is:
When CLI is used through nb and it's a command related to a "bot," it will create the bot before executing the command.
In this process of creating the bot, it will call build_path_and_ensure_state_file!, thereby creating the file. The goal was to ensure that before the bot executes, if it should have a state, the state file is writable and ready to be filled.
The unintended collateral effect is creating a new state file with an empty history for the ones that don't exist when just checking/debugging.

@rcheetah I'm not sure about throwing an error, but in version 3.3.0 and beyond, it will no longer create a file if the state does not exist and will return nil instead:
nb - XPTO state
nil

Can we add a functionality like:
nb - ABC delete-state

?


SPIKE: Investigate tool to implement spam filternig (deny list) for APIs

Our Solr search engine is being hit by (unknown) services that appear to be hosted on a broad/unpredictable range of IP addresses. Caddy does not provide a good method to manage block lists, and while moving to NGINX is possible, it creates extra work to migrate the deployments AND maintain the block lists for a quick-changing set of IPs.
We should look at tools that would allow us to insert an externally-managed layer responsible for filtering requests coming from undesirable addresses (e.g.: botnets) and that could be reused for our other services as well.
A first step is talking to the Platform Services team to get input on options other BCGov projects are using.
Acceptance Criteria:

[ ] Determine best option to protect APIs and manage block lists
[ ] Assess and propose required changes for OrgBook )(to begin with)

@ShellyXueHan @mitovskaol @NickCorcoran: is there any tool the Platform team is using for this purpose?
c.c.: @WadeBarnes

BCGov API gateway: https://bcgov.github.io/aps-infra-platform/guides/owner-journey-v1/


Update the wasm-tools family of crates

Keeping up-to-date, no other pressing reason to update.

This is actually going to be significantly more involved than I originally predicted, so will reopen later.


Add support for Bresser Lightning Sensor

BresserWeatherSensorReceiver supports the lightning sensor. Consequently, integration should be added as an option to BresserWeatherSensorTTN  as well.
Also see #70  Implement lightning sensor data post-processing.

Support for Bresser Lightning Sensor added in https://github.com/matthias-bs/BresserWeatherSensorTTN/pull/64
Provides 'lightning_count' and 'lightning_distance'.


Externals packaging prioritises yarn.lock lookup

Describe the bug
When packing externals, the Utils/findUpIO willl recursively search up the directory structure for a given file and the function findProjectRoot calls this function sequentially looking for yarn.lock, pnpm-lock.yaml and package-lock.json.
In case you are using pnpm or npm instead of yarn BUT you have a yarn.lock somewhere up the directory structure, it will cause a fail-ure.
To Reproduce

Setup a basic serverless with esbuild project, define any externals. Use npm with a package-lock.json file in your project
Somewhere, anywhere up the folder structure create a yarn.lock file.
Execute sls package.

Expected behavior
The build should work....
Screenshots or Logs
lifecycle:command:invoke:hook: [16] < before:package:createDeploymentArtifacts
Compiling to node18 bundle with esbuild...
Compiling with concurrency: Infinity
Compiling completed.
plugin:serverless-esbuild: Trying to create packager: npm
plugin:serverless-esbuild: Packager created: npm
lifecycle:command:invoke:hook: [16] > before:package:createDeploymentArtifacts
process: handle error
process: finalize { error:
   { Error: ENOENT: no such file or directory, open '/Users/anonymous/package.json'
       at Object.openSync (node:fs:600:3)
       at Object.readFileSync (node:fs:468:35)
       at readFileSync (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/utils/fs/read-file-sync.js:7:24)
       at Utils.readFileSync (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/classes/utils.js:78:12)
       at EsbuildServerlessPlugin.packExternalModules (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless-esbuild/dist/pack-externals.js:212:51)
       at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
       at async before:package:createDeploymentArtifacts (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless-esbuild/dist/index.js:78:17)
       at async PluginManager.runHooks (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/classes/plugin-manager.js:530:9)
       at async PluginManager.invoke (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/classes/plugin-manager.js:563:9)
       at async PluginManager.run (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/classes/plugin-manager.js:604:7)
       at async Serverless.run (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/serverless.js:179:5)
       at async /Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/scripts/serverless.js:834:9
     [stack]:
      "Error: ENOENT: no such file or directory, open '/Users/anonymous/package.json'\n    at Object.openSync (node:fs:600:3)\n    at Object.readFileSync (node:fs:468:35)\n    at readFileSync (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/utils/fs/read-file-sync.js:7:24)\n    at Utils.readFileSync (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/classes/utils.js:78:12)\n    at EsbuildServerlessPlugin.packExternalModules (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless-esbuild/dist/pack-externals.js:212:51)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async before:package:createDeploymentArtifacts (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless-esbuild/dist/index.js:78:17)\n    at async PluginManager.runHooks (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/classes/plugin-manager.js:530:9)\n    at async PluginManager.invoke (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/classes/plugin-manager.js:563:9)\n    at async PluginManager.run (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/classes/plugin-manager.js:604:7)\n    at async Serverless.run (/Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/lib/serverless.js:179:5)\n    at async /Users/anonymous/Projects/theProjectInQuestion/node_modules/serverless/scripts/serverless.js:834:9",
     [message]: "ENOENT: no such file or directory, open '/Users/anonymous/package.json'",
     errno: -2,
     syscall: 'open',
     code: 'ENOENT',
     path: '/Users/anonymous/package.json' },
  shouldBeSync: undefined,
  telemetryData: undefined,
  shouldSendTelemetry: undefined }

Versions (please complete the following information):

OS: Mac
Serverless Framework Version: 3.32.2
Plugin Version: 1.46.0

I thought of 2 possible solutions:

Since you already know you the packer you will use, you could narrow down the search and only look for the lock file specific to your packer.
a.   In my case the issue was clear: it found a location of a yarn.lock file and then tried to call npm run beforePackage on it.
Instead of triggering the search multiple times for each individual lock file name, search only 1 time using all of them as valid options for a match.

Instead of:
const findUpIO = (name: string, directory = process.cwd()): IOO.IOOption<string> =>
  pipe(path.resolve(directory), (dir) =>
    pipe(
      safeFileExistsIO(path.join(dir, name)),
      IO.chain((exists: boolean) => {
        if (exists) return IOO.some(dir);
        if (isPathRoot(dir)) return IOO.none;
        return findUpIO(name, path.dirname(dir));
      })
    )
  );

/**
 * Forwards `rootDir` or finds project root folder.
 */
export const findProjectRoot = (rootDir?: string) =>
  pipe(
    IOO.fromNullable(rootDir),
    IOO.fold(() => findUpIO('yarn.lock'), IOO.of),
    IOO.fold(() => findUpIO('pnpm-lock.yaml'), IOO.of),
    IOO.fold(() => findUpIO('package-lock.json'), IOO.of),
    IOO.toUndefined
  )();

Have something like:
const findUpIO = (**names: string[]**, directory = process.cwd()): IOO.IOOption<string> =>
  pipe(path.resolve(directory), (dir) =>
    pipe(
      **array.some(names.map((name) => safeFileExistsIO(path.join(dir, name))))**,
      IO.chain((exists: boolean) => {
        if (exists) return IOO.some(dir);
        if (isPathRoot(dir)) return IOO.none;
        return findUpIO(name, path.dirname(dir));
      })
    )
  );

/**
 * Forwards `rootDir` or finds project root folder.
 */
export const findProjectRoot = (rootDir?: string) =>
  pipe(
    IOO.fromNullable(rootDir),
    IOO.fold(() => findUpIO(['yarn.lock', 'pnpm-lock.yaml', 'package-lock.json'), IOO.of),
    IOO.toUndefined
  )();

I know this is a crude solution, and I haven't given much thought and effort into how it would fit into the overall code, but perhaps it will help speed things up and shorten the time it takes to fix this.

I can confirm this issue. We spent some time debugging it, and the cause was looking up the directory tree and finding a package-lock.json outside of the repo.


Post-processing fails when returning an object

This is definitely a noob question but I couldn't find an answer in the docs on to why this wouldn't work.
Also, in the tutorial linked 0, there is an example of this behavior that gives an error:
N -> [0-9]:+ {% d => { type: 'NUMBER', value:parseInt(d[0].join(''), 10) } %}

When nearley-test'ing that, I get:
{"name": "N", "symbols": ["N$ebnf$1"], "postprocess": d => { type: 'NUMBER', value:parseInt(d[0].join(''), 10) }}
                                                                                ^
SyntaxError: Unexpected token :
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    [...]

Has there been some API change or anything that I'm not aware of?
Thanks.

Ah, this isn't a nearley issue, but a JS issue. It's parsing the {}s as a block of statements rather than a JSON object for some reason. You can fix it by surrounding it in parentheses to force JS to parse it as an expression, like this:
d => ({ type: 'NUMBER', value:parseInt(d[0].join(''), 10) })

Oooooh man, you're right!

It's parsing the {}s as a block of statements rather than a JSON object for some reason.
Yeah, that's how arrow syntax works.

Thank you and sorry for bothering.

No problem — it's a tricky JS quirk, and I'm glad I could help. :-)


draft: output guard + output predicate in challenge

Note
This is now a draft for discussion purpose! (would keep on working to make it review ready, however, want early feedbacks)
This draft shows what I think how we can do outputGuard and output predicate (I named it SpendingCondition in the code here).
Output type and registries
There are two registries here: Output guard parser + Spending Condition (Output Predicate)
Instead of having those in PlasmaFramework, I think it is fair to just register these two per tx type. First, it saves some gas when getting data, also it mitigate the area how these two registries can impact. This makes output type only unique under same tx type. I think it is totally fine and good.
Output guard
The basic logic does the following:

if outputType == 0 --> output.outputGuard hold owner address directly.
else --> parse the output data from outputGuardParser

We need to be able to get the outputGuardParser, thus a registry for outputGuardParser.
So far I only put one function (parseExitTarget) in and I think this IOutputGuardParser interface should be general enough for all tx types to use (?).
Also, since output guard value is verified in the step startStandardExit. To save some gas, we save only the hash of all data needed in challengeStandardExit step and pass those data as input (check the variable challengeDataHash). So we don't need to verify those data again in other steps as well as not need to save multiple data in storage.
Spending Condition (Output Predicate)
I made Output Predicate (SpendingCondition) bind to tx type.  (see: IPaymentSpendingCondition).
I am just not sure whether that is general enough or not as current interface does not pass in whole output data (eg. token and amount) to the SpendingCondition contract.
function verifyViaOutputGuard(
        bytes calldata _outputGuardData,
        uint256 _utxoPos,
        bytes32 _outputId,
        bytes calldata _consumeTx,
        uint8 _inputIndex,
        bytes calldata _witness
    ) external returns (bool);

In this one, utxoPos and outputId serves same purpose, where checks with consumeTx.inputs[inputIndex]. Only one of them would be used actually. This is how we can support both utxoPos and outputId to be as input format.
outputGuardData  provide us data of authentication owner, eg. venue address or trader address depends on the need. The SpendingCondition contract would knows how to parse the outputGuardData. (Quite likely reuse the outputGuardParser)
witness holds all proof data to be used. eg. output owner signature, confirm signature, zk-snark proof data, zk-snark proof public inputs. (is this a good idea?)

The another function verifyViaOwner is just a simplified version of the previous one when output guard is not needed.
For DEX tx consuming Payment, it would be using output guard.
For transition to ERC721 tx, I think they can just use output type 0, where owner info is directly in output guard field. Would be using different Spending Condition because the consume tx type of ERC721 tx is different from Payment tx.

After taking @kevsul 's advice, we can do the following interface:
    function verify(
        bytes calldata _outputOwnershipData,
        uint256 _utxoPos,
        bytes32 _outputId,
        bytes calldata _consumeTx,
        uint8 _inputIndex,
        bytes calldata _witness
    ) external view returns (bool);

Here are some alternatives I can think of
1.
    function verify(
        bytes32 _outputGuard, // this would be the same data as outputGuard field in tx
        uint256 _utxoPos,
        bytes32 _outputId,
        bytes calldata _consumeTx,
        uint8 _inputIndex,
        bytes calldata _witness // output guard pre image would be here
    ) external view returns (bool);

We can do this since output guard pre image can and quite likely would be part of witness of the consuming transaction. I actually prefer this one then the first one as this would be more consistent with the transaction.

    function verify(
        bytes _output, // encoded output data
        uint256 _utxoPos,
        bytes32 _outputId,
        bytes calldata _consumeTx,
        uint8 _inputIndex,
        bytes calldata _witness
    ) external view returns (bool);

If we need data more then just outputGuard (eg. token, amount) then this is probably what we need.
One critical question though:
Does DEX need the information of token and amount ? @paulperegud

would reopen using branch inside org instead of fork. closing this.


Remove version: GitHub.GitHubDesktop version 3.2.9

[Automated] It returns code over 400 in all urls
Microsoft Reviewers: Open in CodeFlow

Close with reason: Publisher has changed their URL structure;


vim: gS incorrectly joins line continuation

Consider this vim code:
call tbone#send_keys("bottom-right",
  \ "\<c-e>\<c-u>".a:cmd.(a:run ? "\<cr>" : ""))

gS joins it like this:
call tbone#send_keys("bottom-right", \<c-e>\<c-u>".a:cmd.(a:run ? "\<cr>" : ""))
"                                    ^--missing double-quote

I can't seem to reproduce the issue, so it's probably a matter of settings. I guess I have to figure out which, though. Do you have your .vimrc somewhere online? I could take a look and try to guess what it could be.
The other thing to try is to execute these commands manually, in an empty file with just this code:
2s/^\s*\\//
1,2join

This is set of commands that are performed on my installation. It would be useful to run them manually and let me know if they have the same issue, for some reason.

I'll try to narrow it down, thanks!

@justinmk Did you have the chance to try these two commands, see what results you get?

Forgot. Will try


Flagging table does not respond to switches properly

Describe the bug
I went through the shiny app with one dataset, and then went to the first page to try another dataset in the same session. The second dataset loaded fine into the app, and the flagging table loaded fine, but the switches no longer changed the summary removed/retained when turned on/off, and I believe was no longer affecting the tadat$removals or some other reactive object. I am wondering if this is due to the unpredictable behavior of observes within observers, which occurs in the observeEvent function in the flagging module.
To Reproduce
Steps to reproduce the behavior:

Load one test dataset, and run flagging functions
Load second test dataset, re-run flagging functions
Switch on an off switch with results affected and look at summary table

Expected behavior
The flagging table should be responsive to multiple datasets in one session.

@cristinamullin Because of this issue, please advise users to reload the shiny app when starting with a new dataset.

No problem, thanks for the heads up

I think it is fine to address this issue by simply adding a warning or text on the import tab to tell users that they must reload the shiny app before starting to work with a new dataset.


A new GKE cluster for PR experiments.

Currently, PR experiments 1) share the same cluster as daily experiments, 2) need more resources to run more than 2 parallel GKE JOB.
We need to create a new cluster to host them so that it won't block daily experiments or other PR experiments.

Done!
Added a new node pool for this. Now we can have up to 99 PR experiments.


Task group waits for each task, sequentially

Bug description
When checking tasuku in the playground, I noticed a single task group with 3 tasks of 1 second each takes 3 seconds, when I expected that it should complete after just over 1 second.

Reproduction
The code is available in the playground https://stackblitz.com/edit/tasuku-demo-vwyx8w?file=index.js
Environment

tasuku version: ^1.0.0
Operating System: node
Node version: v18.18.0
Package manager (npm/yarn/pnpm) and version: 10.2.3

Expected behavior. I think what you want is this: https://github.com/privatenumber/tasuku#running-tasks-in-parallel


Refactor traefik with package

Split a bit traefik into package. The idea behind this refactor is to start move inter-dependencies away and do some DRY or SRP or both :stuck_out_tongue_closed_eyes: . 🐙

Adds a provider package, with providers except web.go
Adds a types package with common struct.
Move gen.go to an autogen package

The 2nd commit is optional, but will be needed at some point :see_no_evil:.
To test heavily as it might breaks things that are not covered yet :smile_cat:.
🐸
Signed-off-by: Vincent Demeester<EMAIL_ADDRESS>

Great!
Just to understand, web.go needs more refactoring before moving it ?

@emilevauge yeah, but I was even wondering if it should treat the same as the other providers — because to me, it's not the same kind of provider (per se).
That's why I did not move it to the provider package.

OK, I understand it's a bit special. @ldez, what do you think? Moving it in provider package or not?

I agree with @vdemeester : WebProvider is different.
The API part can be assimilate as other provider but static content not.
It's contains different kind of things : REST API & static content.
Using the web but not with the same purpose.
Review the name ?

@ldez I would even handle it differently (and not making it implement Provider).

That's true. I know it should be done differently. We should make a proposal.

Ok, passing this to code review then :wink:. We'll refactor the web provider in another PR (to make this one not too big).

Only one little comment, other than that, LGTM!
Well done @vdemeester :)


Small UX update for add button

Added class "archetypeAddButton" to the button so it can make use of the
CSS that is writen for it.
The button should also have a cursor: pointer on hover.

:+1: Thx, i'll review this and it'll probably make the next patch release.

Merged thx!

Perfect :ok_hand:


Add space lube tube

About the PR

Media

Changelog

:cl:

add: added space lube tube - use it on items to make them slip out of hands!

i am still not sure how to properly add prefix to an item (also see #17381)

What about the nuke disk? I’m sure someone will do it at some point

What about the nuke disk? I’m sure someone will do it at some point

It will be funny

new cap meta lube dat fukken disk so nukies cant use it

Just to make things clear - lubed items will slip next X times you pick them up (X is random but depends on amount of lube)

changed tube sprite back to white as it was quite awful. Still can't really see contents


Construction of dump dirpath not appending '/'

The check for whether PDUMP_DUMP_DIR ends with a '/' is faulty. The fix is to replace line 103:
if (!dump_dir_str[back] == '/') {
... with this:
if (dump_dir_str[back] != '/') {
... in perf_dump.C.

Care to submit a PR?

I assume you mean push a branch, and PR that? I did try to push but I was denied permission.

@aowenson: if you fork the repository, then push the branch in your own fork, you can submit a PR to the main perf-dump repo here.  You don't need write access to do this.


 RawKeyDownEvent || _keysPressed.isNotEmpty'

When I started the project it was probably because I touched a button on my computer that the development environment flutter 3.7, windows emulator started

Steps to Reproduce

Execute flutter run on the code sample
...
...

Expected results:
Actual results:

Code sample

Logs

Hi @Li-00
When opening an issue, please try to provide all or some of the information indicated in the template so that we can address this issue properly.

Issue Template
If you are looking for support, please check out our documentation
or consider asking a question on Stack Overflow:
- https://flutter.dev/
- https://api.flutter.dev/
- https://stackoverflow.com/questions/tagged/flutter?sort=frequent

If you have found a bug or if our documentation doesn't have an answer
to what you're looking for, then fill our the template below. Please read
our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports

Steps to Reproduce

Please tell us exactly how to reproduce the problem you are running into.

Please attach a small application (ideally just one main.dart file) that
reproduces the problem. You could use https://gist.github.com/ for this.

If the problem is with your application's rendering, then please attach
a screenshot and explain what the problem is.

1. ...
2. ...
3. ...

Please tell us which target platform(s) the problem occurs (Android / iOS / Web / macOS / Linux / Windows)
Which target OS version, for Web, browser, is the test system running?
Does the problem occur on emulator/simulator as well as on physical devices?

Target Platform:
Target OS version/browser:
Devices:

Run your application with `flutter run --verbose` and attach all the
log output below between the lines with the backticks. If there is an
exception, please see if the error message includes enough information
to explain how to solve the issue.

Run `flutter analyze` and attach any output of that command below.
If there are any analysis errors, try resolving them before filing this issue.

Finally, paste the output of running `flutter doctor -v` here.

Closing this issue, since no information has been provided. Once you provide information in the template, please write a comment and I will reopen this.
Thank you!


Flutter Style guide is buried in a strange place

https://github.com/flutter/engine/blob/master/sky/specs/style-guide.md
Probably belongs in flutter/flutter/docs?
@Hixie

Sure.

Or the wiki. Or the website.

Fixed by Hixie@ in PR #177.

Marking as closed.


Implement the Home screen

Summary

The layout of the main screen has been implemented, and navigation from it has been partially implemented.
Screen stubs have been implemented for navigation.
The project name has been changed.

Reasons

Implemented the Home screen layout to provide users with easy access to app features and navigation options.
Added functionality to list connected devices with relevant information to facilitate efficient device management.

References

closes #24

Codecov Report
Attention: Patch coverage is 0.88496% with 336 lines in your changes are missing coverage. Please review.

Project coverage is 13.34%. Comparing base (550ba45) to head (932bc2c).

Files
Patch %
Lines

...om/softteco/template/ui/feature/home/HomeScreen.kt
0.00%
134 Missing :warning:

...co/template/ui/feature/home/search/SearchScreen.kt
0.00%
37 Missing :warning:

...com/softteco/template/ui/components/DeviceImage.kt
0.00%
34 Missing :warning:

...com/softteco/template/ui/components/PreviewStub.kt
0.00%
29 Missing :warning:

...ature/home/device/connection/AddNewDeviceScreen.kt
0.00%
25 Missing :warning:

.../feature/home/notifications/NotificationsScreen.kt
0.00%
24 Missing :warning:

...lin/com/softteco/template/navigation/AppNavHost.kt
0.00%
22 Missing :warning:

...softteco/template/ui/feature/home/HomeViewModel.kt
0.00%
11 Missing :warning:

.../kotlin/com/softteco/template/navigation/Screen.kt
27.27%
8 Missing :warning:

...kotlin/com/softteco/template/data/device/Device.kt
0.00%
7 Missing :warning:

... and 1 more

Additional details and impacted files
@@               Coverage Diff                @@
##             smart_home      #29      +/-   ##
================================================
- Coverage         14.75%   13.34%   -1.41%
  Complexity           48       48
================================================
  Files                87       94       +7
  Lines              3002     3319     +317
  Branches            530      621      +91
================================================
  Hits                443      443
- Misses             2539     2856     +317
  Partials             20       20

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