improve: aggregate user infos as standalone user context within prompt

@nekomeowww  I am interested to work on this issue.
However, maybe some questions before getting started.
Would you mind to explain more about these terms:

User infos
Standalone user context
Within prompt

Thanks.

@nekomeowww  I am interested to work on this issue.
However, maybe some questions before getting started.
Would you mind to explain more about these terms:

User infos

Standalone user context

Within prompt

Thanks.

Thank you!
Yes you can pick this issue and work on it, but I am afraid of you may suffer to understand and then make changes to OpenAI prompt in pkg/openai/prompt.go due to it was written in Simplified Chinese. And working on this requires a valid OpenAI account to do the prompt engineering.
This issue is meant to improve the chat histories summarization feature (aka. recap), the mean goal is to reduce the token usage of OpenAI prompt.
Before dive into this feature, please allow me to summarize how recap works. There is a middleware called RecordMessage, it will extract and format the chat messages coming from Telegram and then store them into Postgres. When user send the /recap command or it was the time to send a automatic recap message to chat groups (implemented in internal/services/auto recap), the chathistories models will format the messages into the following pattern (implementation at https://github.com/nekomeowww/insights-bot/blob/8665befe035c9d05b19e1ed590ddb3790747255c/internal/models/chathistories/chat_histories.go#L235):
msgId:1 UserName1 sent: ```Hello!```
msgId:2 UserName2 replying to [UserName1 sent msgId:1]: ```Hello! How are you today?```

And then it will inject the pattern into OpenAI prompt template for OpenAI's GPT-3.5 model to summarize the chat histories for us.
You may find out the UserName1 and UserName2 is explicitly stated each time they appears. This can be inefficient for prompt when multiple users appears multiple times when they chatted in a same group.
Therefore I came up with a idea: why don't we aggregate the usernames appeared in the chat histories, and then place a formatted username map before the chat histories, additionally, use userId or array index to represent the username just like this:
Users:"""
1: UserName1
2: UserName2
...
10: UserName10
"""

msgId:1 user:1 sent: """Hello!"""
msgId:2 user:2 replying to [UserName1 sent msgId:1]: """Hello! How are you today?"""
msgId:3 user:3 sent: """Nice to meet you guys!"""
msgId:4 user:10 sent """The party is just about to start!!!"""

The terms can be explained now.

User infos: includes user's full name, username, userId, it will be used later in the prompt. In the example above, I only used username (can be full name too), the number before the username can be userId or just indexes.
Stand-alone user context: it is the part Users: in the above example, it holds the aggregated user names and number it represented for users.
Within prompt is the pattern I talked about above, the formatted message pattern is part of the prompt, the full prompt is located at pkg/openai/prompt.go

I think the best way to let you jump into this issue is to wait for me to implement the i18n support we talked about previously (#67), and then we can use English to write the OpenAI prompt for better understanding. How is that?

Yes you can pick this issue and work on it, but I am afraid of it might be too hard to understand and make changes to OpenAI prompt in pkg/openai/prompt.go for you due to it was written in Simplified Chinese. You will also need a valid OpenAI account to do the prompt engineering

OK. No worries.
Thanks for the explanation.
Do you have recommendation of issues that I can help? Maybe something that needs to be done sooner and requires less dependency (e.g. credentials).

Yes you can pick this issue and work on it, but I am afraid of it might be too hard to understand and make changes to OpenAI prompt in pkg/openai/prompt.go for you due to it was written in Simplified Chinese. You will also need a valid OpenAI account to do the prompt engineering

OK. No worries.
Thanks for the explanation.
Do you have recommendation of issues that I can help? Maybe something that needs to be done sooner and requires less dependency (e.g. credentials).

What do you mean by credentials?

TBH, there aren't any simple and easy issues or ongoing future issues with less dependency for you to work with, due to the lacked support of i18n, and insights-bot is a project that relies on languages and GPT models, we initially developed it with Chinese support only. You may have to wait for us to support i18n.

What do you mean by credentials?

Something like access to GPT products or the telegram bot.

You may have to wait for us to support i18n.

Ok no worries. Thanks.


Beginning of a web-ui

it contains the beginning of a webui:

Framework
Readme how we can extend it
Integration into the Http-Server
included the GraphiQl-Console
own formular, where we can fire graphql-requests
example stuff, how the navigation works, what we can do with bootstrap
done with webpack as a single-page-application

closes #24

@ThomasWolter, cause of the late PR: If you take a look tomorrow on it and i am still in my bed, then  feel free to merge it on your own into develop.
But do this after you merged @GregorFendt PR, cause i have already merged his stuff into my branch for testing purposes


[FormRecognizer] Unify recongize custom form results

Merged the result shape to align with api design decision
Rename refactoring
Format code

/cc @annelo-msft @kristapratico @samvaity


Blazeborn Bug

when i walk on magma blocks, i start taking damage even tho i'm a blaze born. i also notice that you get hurt by a blaze fireball, i don't know if that is intentionally suppose to happen but i just want this bug to be fixed.

This does not happen for me. Could you provide more information, such as which other mods you're playing with, and maybe provide a log file?

I assume this is resolved because you didn't answer.


Writing to a characteristic does not neccesarily mean that subsiquent…

… reads will return that value
I'll push this CL when https://github.com/WebBluetoothCG/web-bluetooth/issues/277 is merged.

👍


[HOLD for payment 2023-04-03] Unwanted double quotes in notification after ... for bigger messages

If you haven’t already, check out our contributing guidelines for onboarding and email<EMAIL_ADDRESS>to request to join our Slack channel!

Action Performed:

Open the app and login with user A
Open the app in android app and login with user B
Send long message from user A to user B

Expected Result:
Larger notifcations should end with ... in the end
Actual Result:
Larger notification ends with ..." in the end (App is adding unwanted double quotes)
Workaround:
unknown
Platforms:

Which of our officially supported platforms is this issue occurring on?

[ ] Android / native

Version Number: 1.2.65-0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos:
https://user-images.githubusercontent.com/43996225/216880746-1c0aa913-58e3-4fa1-a43b-8238c1eb6877.mp4

Expensify/Expensify Issue URL:
Issue reported by: @dhanashree-sawant
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1675500083078039
View all open jobs on GitHub
Upwork Automation - Do Not Edit

Upwork Job URL: https://www.upwork.com/jobs/~01441300c2ff47e240
Upwork Job ID:<PHONE_NUMBER>140704768
Last Price Increase: 2023-02-17

Need to try and reproduce! Haven't been able to so far

Job added to Upwork: https://www.upwork.com/jobs/~01441300c2ff47e240

Current assignee @zanyrenney is eligible for the External assigner, not assigning anyone new.

Triggered auto assignment to Contributor-plus team member for initial proposal review - @parasharrajat (External)

Triggered auto assignment to @johnmlee101 (External), see https://stackoverflow.com/c/expensify/questions/7972 for more details.

I've posted a Proposal for similar problem.
To say short I suppose this logic is on the airship service side
https://github.com/Expensify/App/issues/14715#issuecomment-1414433837

@alexxxwork That can not be counted as a proposal as it does not propose any solutions with the analysis.

Yeah, of course.  But I think the most right thing to do is to address the problem to airship service. It would be a hard task to write rules for notification messages truncation on app side without thorough knowledge of how this work inside the airship service.

Ok, @alexxxwork. IMO, Maybe this can easily be resolved from the app side with the proper configuration of the notification builder. I don't think we need to know anything about airship service. the Logic should already be there in the source.

@parasharrajat ok, we could go this way - this way we should count symbols on our side and truncate string sent to notification service. I'll write down a proposal by template.

thanks for communicating @parasharrajat - still waiting for proposals here!

Proposal
Please re-state the problem that we are trying to solve in this issue.
We are trying to resolve an issue in long string coming to notifications on android native. Strings more than 115 ascii symbols get truncated with ...'' in the end.
What is the root cause of that problem?
The root cause of the problem is limits of the airship service for android plaform. doc
What changes do you think we should make in order to solve the problem?

We should truncate string on our side here
https://github.com/Expensify/App/blob/5a5b788afd91b765bab9d2dfd5de7d3468f0a216/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java#L84
What alternative solutions did you explore? (Optional)
We could address this issue upstream to airship

Now sure, I understand the proposal.

How can you trim the message?
How will it solve the problem? What is the run-through?

Don't we have any API on the builder or something to customize the notification format? I like your optional solution. Do you want to raise it with them?

@parasharrajat We should count symbols in notification string taking in account that airship uses different encodings (we should analyze every symbol) and truncate it on our side in desired format so it doesn't truncated on airship side.
I believe it's better to raise Airship attention on the problem because the above solution is only a workaround.

Yes, I don't think this is the right way to trim the message. It might cause other issues and also what you are proposing has maintains cost to it.

@parasharrajat So how should I address the issue to airship support? I suppose it's a commercial contract?

I think we can start with creating an issue on their repo.

@parasharrajat Airship react native readme (https://github.com/urbanairship/react-native-airship) says we should address issues to https://support.airship.com/. Should I make a service request?

@johnmlee101 @parasharrajat @zanyrenney this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

Waiting for the ticket confirmation about the bug!

@parasharrajat @johnmlee101
I've made some log investigation and found out that every message from airship server has a truncated field (with extra '') com.urbanairship.push.ALERT and there's full message in payload.
In this scenario I sent messages from web and received them on android hardware device, watching logs in android studio.
2023-02-22 00:39:59.578 17245-18660 New Expensify - UALib   com.expensify.chat                   V  PreferenceDataStore - Saving preference: com.urbanairship.push.LAST_CANONICAL_IDS value: ["7749ee50-b213-11ed-8c09-0242d4a8d64f","54b98200-b21e-11ed-86f2-024295e9d6d7","77435da1-b21e-11ed-8cac-0242b28558ca","9ea15690-b21e-11ed-ad50-0242f634f6e4","b3d6df80-b21e-11ed-8cac-0242b28558ca","34f22c50-b21f-11ed-9bab-0242324b2584","ebc6a2e1-b21e-11ed-bf50-0242a2b5b483","0269c590-b21f-11ed-8874-0242b38fb08d","0f0fd6e1-b21f-11ed-a6b1-024234499bf7","85a50c31-b21f-11ed-b53e-02428a9146a9"]
2023-02-22 00:39:59.583 17245-18659 New Expensify - UALib   com.expensify.chat                   E  Notification channel<PHONE_NUMBER>225040 does not exist. Falling back to com.urbanairship.default
2023-02-22 00:39:59.584 17245-18659 New Expensify - UALib   com.expensify.chat                   V  NotificationIdGenerator - Incrementing notification ID count
2023-02-22 00:39:59.585 17245-18659 New Expensify - UALib   com.expensify.chat                   V  NotificationIdGenerator - Notification ID: 1010
2023-02-22 00:39:59.586 17245-18662 New Expensify - UALib   com.expensify.chat                   V  PreferenceDataStore - Saving preference: com.urbanairship.push.LAST_RECEIVED_METADATA value: eyJ2ZXJzaW9uX2lkIjoxLCJ0aW1lIjoxNjc3MDA4Mzk3NTEzLCJwdXNoX2lkIjoiODVhNTBjMzEtYjIxZi0xMWVkLWI1M2UtMDI0MjhhOTE0NmE5IiwiY2FtcGFpZ25zIjp7ImNhdGVnb3JpZXMiOltdfX0=
2023-02-22 00:39:59.589 17245-18659 New Expensify - UALib   com.expensify.chat                   D  IncomingPushRunnable - Received result status 0 for push message: {fromExpensify=true, com.urbanairship.metadata=eyJ2ZXJzaW9uX2lkIjoxLCJ0aW1lIjoxNjc3MDA4Mzk3NTEzLCJwdXNoX2lkIjoiODVhNTBjMzEtYjIxZi0xMWVkLWI1M2UtMDI0MjhhOTE0NmE5IiwiY2FtcGFpZ25zIjp7ImNhdGVnb3JpZXMiOltdfX0=, com.urbanairship.push.APID=0bd51415-27ec-48c4-a8cc-7767b80281d7, payload={"title":"spam@vcc.vc","type":"reportComment","reportID":4148003058225040,"shouldScrollToLastUnread":true,"roomName":null,"onyxData":[{"onyxMethod":"merge","key":"report_4148003058225040","value":{"reportID":"4148003058225040","maxSequenceNumber":42,"lastActionCreated":"2023-02-21 19:39:56.640","lastVisibleActionCreated":"2023-02-21 19:39:56.640","lastReadTime":"2023-02-21 19:35:11.928","lastMessageText":"01234567890123456789012345678901234567890123456789012345678901234567890123456789","lastActorEmail":"spam@vcc.vc"}},{"onyxMethod":"merge","key":"reportActions_4148003058225040","value":{"1819390685033551052":{"person":[{"type":"TEXT","style":"strong","text":"spam@vcc.vc"}],"actorEmail":"spam@vcc.vc","actorAccountID":13031568,"message":[{"type":"COMMENT","html":"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789","text":"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789","isEdited":false}],"originalMessage":{"html":"0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"},"avatar":"https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/avatar_4.png","created":"2023-02-21 19:39:56.640","timestamp":1677008396,"reportActionTimestamp":1677008396640,"automatic":false,"sequenceNumber":42,"actionName":"ADDCOMMENT","shouldShow":true,"clientID":"","reportActionID":"1819390685033551052","isAttachment":false}},"shouldNotify":true}]}, com.urbanairship.push.CANONICAL_PUSH_ID=85a50c31-b21f-11ed-b53e-02428a9146a9, com.urbanairship.push.PUSH_ID=85b22b90-b21f-11ed-818f-0242b2c0f5a9, com.urbanairship.notification_channel=4148003058225040, com.urbanairship.push.ALERT=0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234..."<EMAIL_ADDRESS>2023-02-22 00:39:59.593 17245-18659 New Expensify - UALib   com.expensify.chat                   I  Posting notification: Notification(channel=CHANNEL_MESSAGES shortcut=null contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0xff2eaae2 category=msg vis=PUBLIC semFlags=0x0 semPriority=0 semMissedCount=0) id: 1010 tag: null

So messages are truncated server-side in a wrong manner, but there's full message in payload

Waiting for the ticket confirmation about the bug!

@johnmlee101 @parasharrajat
https://support.airship.com/hc/en-us/requests/89947

📣 @alexxxwork! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.

Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

Contributor details
Your Expensify account email<EMAIL_ADDRESS>Upwork Profile Link: https://www.upwork.com/freelancers/~01558071651a8abfb5

✅ Contributor details stored successfully. Thank you for contributing to Expensify!

@alexxxwork Please share updates regularly on the progress of ticket.

@parasharrajat I have provided requested additional info and they are investigating the issue.

Hi, I'm Fábio from Callstack and I would like to take a look at this issue.

@parasharrajat not much. I've provided some additional info on the ticket like AndroidManifest.xml, Airshipconfig.plist and so on. They asked to test push message truncation on their test app. Working on it now.

Thanks for jumping in here @fabioh8010 !

Current assignee @parasharrajat is eligible for the Internal assigner, not assigning anyone new.

hey @parasharrajat - that's done now!

What is the latest here @johnmlee101 ?

I'm taking over as this is an internal server issue that I'm going to resolve as part of this wider task.

Sounds good @Julesssss - thank you for the update!

We also agreed to compensate you for the same #14715 (comment) on another issue.

@parasharrajat Could you please explain how this should work? Should I just wait for these issues to be resolved?

What's the latest here @Julesssss ?

Basically, this issue is already fixed, but I can't merge it yet.

It modifies a lot of existing logic that handles notifications for OldDot, so I need to be very careful about the fix and roll out. I am migrating to a different method of building notifications, so we'll need to deploy the new method, but continue to be backward compatible for older users before making the final backend change.
Maybe we should hold this one in the meantime to avoid needing daily updates -- because they won't really be related to THIS issue.

Thanks for that!, So we're in a holding pattern here.

PR in review

Reviewing label has been removed, please complete the "BugZero Checklist".

The solution for this issue has been :rocket: deployed to production :rocket: in version 1.2.89-0 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

https://github.com/Expensify/App/pull/15857

If no regressions arise, payment will be issued on 2023-04-03. :confetti_ball:
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.

[ ] External issue reporter
[ ] Contributor that fixed the issue
[ ] Contributor+ that helped on the issue and/or PR

As a reminder, here are the bonuses/penalties that should be applied for any External issue:

Merged PR within 3 business days of assignment - 50% bonus
Merged PR more than 9 business days after assignment - 50% penalty

BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

[ ] [@parasharrajat / @Julesssss] The PR that introduced the bug has been identified. Link to the PR:
[ ] [@parasharrajat / @Julesssss] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[ ] [@parasharrajat / @Julesssss] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[ ] [@zanyrenney] Determine if we should create a regression test for this bug.
[ ] [@parasharrajat] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[ ] [@zanyrenney] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

Hey @zanyrenney, I checked off the boxes here on your behalf as this wasn't a regression.
We are now ready for payment 🎉

Hmm weird, this was closed on March 19th.

hey @Julesssss I will DM you as there are a few odd things about this one

I've chatted to @Julesssss about this one. Seeing as this issue is a dupe of an internal issue that has been fixed as a result of https://github.com/Expensify/App/issues/14849#issuecomment-1461761472 we'll just be paying out the $250 reporting bonus and the $250 for reviews as we appreciate the time taken to do those reviews and the report but was not due the full payment due to being resolved elsewhere.

@parasharrajat @dhanashree-sawant invited you both to the job - https://www.upwork.com/jobs/~013b63b7c27ad5bd41

Thanks @zanyrenney , I have accepted the invite.

Hi @alexxxwork. As we didn't assign you to this issue, I don't think so. However, you seem to be eligible for payment on this linked issue. Which is yet to be completely resolved.

Hi @zanyrenney, thanks for the offer on upwork but when I tried to accept it now, it says that job is no longer available, can you have a look once you are available?

Hi @zanyrenney, this bug was originally reported by me here

📣 @Puneet-here! 📣
Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
Please follow these steps:

Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.

Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

@Julesssss, @parasharrajat, @zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick!

@Julesssss, @parasharrajat, @zanyrenney Whoops! This issue is 2 days overdue. Let's get this updated quick!

Hmm, sorry I am confused now. @dhanashree-sawant
dhanashree-sawant i thought you were the reporter. If Puneet-here is the reporter, then you wouldn't get the payment. Can you explain what you're due payment for in this case @dhanashree-sawant ?

Hi @zanyrenney, I agree, Puneet had raised the concern but it was 5 months back from this report and we never went ahead with it until I saw the issue again and reported it (I was not aware of the report as it was in expensify-open-source platform until Puneet pointed it out). Its on you on how to handle the payments.

Ah right. Seems like a fair mistake.

This is a tough call. Given that no further action was taken on the original issue I think the newer bug report should receive the bounty, personally. It looks like it was simply missed originally :/

Thanks @Julesssss I agree.

Hi @zanyrenney,
Payment for the reporting bonus is left.

Re0peing the issue
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694364092518829

This is

Reopeing the issue Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694364092518829

Can you please open a new issue and assign me? This one is 6 months old and while similar, it will require a different solution

Sure, will do that @Julesssss

Link new issue  https://github.com/Expensify/App/issues/27663


Add test to try reset_object with groups inside pageelements

Coverage increased (+0.2%) to 90.521% when pulling 6947f94f4fb3eafc22c63d84e0ea87e2c8f15bb5 on test/page_elements into 7b70e2620ca6896070a12779c872d8d05ca01486 on master.


Vibration Testing

How can test the vibration? I tried some xbox controller testing software but non of them triggered to change the vibration value of the control

As you say. You need some software that sends vibration to the controller.


adjust for poetry >=1.2.0

Finally got around testing the new poetry (I used poetry 1.2.2).
fixes #25 that was not breaking but was a warning about a renamed option. I created a quick backward compatibility gadget for those, in case new things pop up in the future.
Fixes #29 and #30 which were found by the functional tests.
I removed python3.9 in favor of a matrix around poetry to ensure my own backward compatibility 😎

This has been released on pypi.org as a pre-alpha: coveo-stew>=3.0.13a1 if you want to fool around with it.


Doesn't work

Doesn't want to load swfs, loads indefinitely

Could you send me the swf file? Or I would like to have a screen capture.

Link

what's the result?

I can confirm(at least by leaving it open for a few minutes) that the swf provided does not work. Every other swf I have does load though.

@aolko
I think it is a JPEG parsing error. I will fix it.

ETA?

I developing now leisurely, do you hurry?

kinda in a hurry lately

Spewer - Uncaught TypeError: Cannot read property 'MainTimeline' of undefined

sorry. as3 is also a prototype.

@aolko
LL_Save_Tonight.swf now works. for ver: 0.7.8


[Techdocs] Couldn't load the document because css 404 (Not Found)

After I bumped up version of backstage to 1.0.0 . My backstage couldn't load document for using Techdocs plugin and I had got error 404 NOT Found css file as picture below:

After that I had investigated plugin-techdocs-backend code lines and seen that new version of plugin-techdocs-backend have added the code lines check permission if it is enabled.

Expected Behavior
I hope we could load css without authorization check because the css file is public

You will need to enable permissions in app config and also set the auth secret. Also check whether you have set correct CSP
permission:
enabled: true
backend:
Used for enabling authentication, secret is shared by all backend plugins
See backend-to-backend-auth.md in the docs for information on the format
auth:
keys:
- secret: ${BACKSTAGE_BACKEND_AUTH_SECRET}
baseUrl: ${BACKSTAGE_BACKEND_BASE_URL}
listen:
port: 7000
csp:
connect-src: ["'self'", 'http:', 'https:']
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
# Default Helmet Content-Security-Policy values can be removed by setting the key to false
img-src:
# "'self'" and 'data' are from the backstage default but must be set since img-src is overriden
- "'self'"
- 'data:'
- 'https://backstage.io'
- '${BACKSTAGE_BACKEND_BASE_URL}'

'https://backstage.io'

As you known, the css path is usually public so that you can see in techdocs page. It have a link tag to get the css script as picture below.

But techdocs-backend plugin have added authorization as mentioned in document

How can we add authorization to header in http request GET for css tag in html above?

Hi @freben ,
Do you have any idea about this case?
Thanks,
Lam Ly

Hey there!  In order to use TechDocs successfully with the permissions framework, you will need to include some extra code in your backend that sets the auth token on a cookie.  I believe the folks working on the permissions framework will have better documentation for this in place soon!  But for now, you can reference these docs to help you out: https://github.com/backstage/backstage/blob/master/contrib/docs/tutorials/authenticate-api-requests.md

Hi @iamEAP, is the said documentation already in place?

As far as I can see, this is documented most directly here (https://backstage.io/docs/permissions/getting-started#optionally-add-cookie-based-authentication), which provides some better context.
You'll see it still links out to the tutorial I linked to above though.

Hi! same issue here, could not find a way to authorize static assets requests made by the browser when opening techdocs.
I already set up cookie-based authentication.
tagging some band members for visibility: @freben @vinzscam @jhaals

Has anyone found a workaround in the latest versions? I'm using the permissions framework at the moment as well.

This might help you

I also face the same problem with assets


Date format string in settings allows garbage

There is no validation for the date formatting string, so that garbage could be entered which may cause unexpected behaviour when calling Date().format(garbage_string) during file header inserting or during a "modified at" update.
The date formatting should comply with ISO 8601 which specifies how to construct a valid format string and specifies what characters are allowed.,

I constructed a regex:
(?=\D*(?:[y]{1,4}|[Md]{2,3})(?:[/\-., ])?((?:[y]{1,4}|[Md]{2,3})(?:[/\-., ])?)?(?:[y]{1,4}|[Md]{2,3})(?:[., ]*)?)(?=\D*((?:[hms]{2}[:. ]?(?:[hms]{2})?[:. ]?(?:[hms]{2})?[:. ]?S?)(?:[., ]*)?))^[yMdhmsS:.,/\- ]*$
There are two look-aheads in this regex. In the first one, it looks for strings of the form yyyy-MM-dd, and permits the letters in any order, and with several allowable optional seperators ('', '-', '.', ',' and space) so that ddMMyy MM/dd/yyyy, etc, are permitted,
(?=\D*(?:[y]{1,4}|[Md]{2,3})(?:[/\-., ])?((?:[y]{1,4}|[Md]{2,3})(?:[/\-., ])?)?(?:[y]{1,4}|[Md]{2,3})(?:[., ]*)?)
The second look-ahead checks for any time portion, with hmsS as allowable characters, with several optional separators, so that hh:mm, hh.mm.ss, and hhmmss.S are all permitted.
(?=\D*((?:[hms]{2}[:. ]?(?:[hms]{2})?[:. ]?(?:[hms]{2})?[:. ]?S?)(?:[., ]*)?))
Both of the above look-ahead groups are prefixed with ?=\D*, which defines a look-ahead and begins the search by looking for 0 or more non-digit characters (e.g. the start of the string! It didn't work by explicitly using the ^ character for the start of the string).
By using look-aheads, we can allow matches to either group to be in any order without having to repeat the portions multiple times to allow the different combinations.
The final section of the regex actually returns the text, as this is not a look-ahead group. We could simply have used ^.*$ here, but this way we only return the combined set of allowable characters permitted in either look-ahead group, which adds an extra validation.
^[yMdhmsS:.,/\- ]*$
I used the tool at (regexr.com)[https://regexr.com] to construct and test the regex, with the following text to check it works:

yyyy-MM-dd mm:hh

yyyy-MM-dd hh:mm:ss

yy/MM/dd hh.mm.ss.S

yyyy/MM/dd

hh:mm:ss yy/MM/dd
yy/MM/dd hh:mm:ss

hh.mm.ss.S yy/MM/dd

hh:mm:ss.S

MM/dd/yy

dd/MM/yy
hh.mm.ss.S
hh mm ss yyyy MM dd
hh/mm/ss
MM/yy/dd hh

hh:mm:ss yy/MM/dd

dd/yy/

yy/dd/MM

yy/MM/dd/MM

And finally, by putting the completed regex into (freeformatter.com)[https://www.freeformatter.com/json-escape.html#before-output] we can escape all the characters that need to be escaped so that we can paste the regex into the "pattern" field of package.json.
Here is the completed json block with validation:
"fileheader.dateFormat": { 					"type": "string", 					"default": "yyyy-MM-dd hh:mm:ss", 					"markdownDescription": "The date & time format to use for indicating when a file was created or last modified at.", 					"pattern": "(?=\\D*(?:[y]{1,4}|[Md]{2,3})(?:[\/\\-., ])?((?:[y]{1,4}|[Md]{2,3})(?:[\/\\-., ])?)?(?:[y]{1,4}|[Md]{2,3})(?:[., ]*)?)(?=\\D*((?:[hms]{2}[:. ]?(?:[hms]{2})?[:. ]?(?:[hms]{2})?[:. ]?S?)(?:[., ]*)?))^[yMdhmsS:.,\/\\- ]*$", 					"patternErrorMessage": "Please input a valid date formatting string (Refer to ISO-8601 for more information).", 					"order": 4 				}

This fix was released as part of release-candidate-v0.2.2 - keeping the issue open to allow any user feedback since this was a complex regex and may cause issues. Return in 7 days and if no issue, can close this.


[feat] Update CryptoCompare to Websocket

Implementation details

Do 1
Do 2

Please ensure the following requirements are met before submitting a pull request:

[ ] The pull request is targeted against the correct target branch
[ ] The pull request is linked to an issue with appropriate discussion and an accepted design OR is linked to a spec that describes the work.
[ ] The pull request includes a description of the implementation/work done in detail.
[ ] The pull request includes any appropriate unit/integration tests
[ ] You have added a relevant changelog entry to CHANGELOG.md
[ ] You have re-reviewed the files affected by the pull request (e.g. using the Files changed tab in the GitHub PR explorer)

@warittornc please fix conflict.


error retrieving annotation collection when adding Prefer field to header

when fetching annotation collection content in terminal this works:
curl http://purl.bdrc.io/anncollection/ANCWCBC2237_C001
-H "Accept: application/json"
-H 'Prefer: return=representation;include="http://www.w3.org/ns/oa#PreferContainedDescriptions"'

but in javascript it fails when using prefer in header:
Failed to load http://purl.bdrc.io/anncollection/ANCWCBC2237_C002: Request header field prefer is not allowed by Access-Control-Allow-Headers in preflight response.
whereas without prefer in header it works

can you try with latest version? (I just deployed it)

seems to be working fine
thanks!

ok thanks!


Add tvOS Support

Using this in my current pod spec and app for a while actually. Works great!

Yes I use that too. Works perfectly !

Thanks; I already added this in another commit, but thank you for the submission.


Incorrect patching when using ReferenceHandler.Preserve on JsonSerializerOptions

Environment

Nuget Package: JsonPatch.Net
Nuget Version: 1.1.0
OS: Windows
.Net Target: .Net 6

Describe the bug
JsonPatch.Net fails to correctly apply a patch when using ReferenceHandler.Preserve in the JsonSerializerOptions that you can pass when applying the patch on array's which contains new content
To Reproduce
(Will make some code to show the issue later today)
Expected behavior
JsonPatch.Net applies a patch on an array with new content correctly when using ReferenceHandler.Preserve.
Additional context

Thanks for reporting this.  The serializer options param was recently added as part of PR
It looks like the option in question, ReferenceHandler.Preserve, was added as of .Net 5.
If you could post some examples for which this fails, that would help a lot.

So sorry for the wait! Here's an example of the issue.
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
using System.Text.Json.Serialization;
using Json.More;
using Json.Patch;

namespace JSONPatchIssue
{
    public class Program
    {
        private static readonly JsonSerializerOptions SerializerOptions = new()
        {
            ReferenceHandler = ReferenceHandler.Preserve,
            WriteIndented = true
        };

        public static void Main()
        {
            var testApplication = new ApplicationStore()
            {
                Applications = new List<Application>
                {
                    new Application()
                    {
                        Name = "OBS",
                        FileName = "obs64.exe",
                        Location = Directory.GetCurrentDirectory()
                    }
                }
            };

            var test2Application = new ApplicationStore()
            {
                Applications = new List<Application>(testApplication.Applications)
                {
                    new Application()
                    {
                        Name = "OBS 2",
                        FileName = "obs64.exe",
                        Location = Directory.GetCurrentDirectory()
                    }
                }
            };

            var patch = testApplication.CreatePatch(test2Application);

            /*Notice that it ONLY happens when the content is passed in as a JsonDocument
              and what should of been applied was added in the incorrect place*/
            var brokenPatchedFile = patch.Apply(testApplication.ToJsonDocument(SerializerOptions).RootElement);
            Console.WriteLine("Broken patch file:");
            Console.WriteLine(brokenPatchedFile.Result);
            Console.WriteLine();

            var patchedFile = patch.Apply(testApplication).ToJsonDocument();
            Console.WriteLine("Patch file:");
            Console.WriteLine(patchedFile.RootElement);
        }
    }

    public class ApplicationStore
    {
        public List<Application> Applications { get; set; } = new List<Application>();

        //Logic to use data would be here
    }

    public class Application
    {
        public string Name { get; init; } = string.Empty;

        public string Location { get; init; } = string.Empty;

        public string FileName { get; init; } = string.Empty;
    }
}

Output:
Broken patch file:
{"$id":"1","Applications":{"$id":"2","$values":[{"$id":"3","Name":"OBS","Location":"C:\\Users\\aaron\\RiderProjects\\JSONPatchIssue\\JSONPatchIssue\\bin\\Debug\\net6.
0","FileName":"obs64.exe"}],"1":{"Name":"OBS 2","Location":"C:\\Users\\aaron\\RiderProjects\\JSONPatchIssue\\JSONPatchIssue\\bin\\Debug\\net6.0","FileName":"obs64.exe
"}}}

Patch file:
{"Applications":[{"Name":"OBS","Location":"C:\\Users\\aaron\\RiderProjects\\JSONPatchIssue\\JSONPatchIssue\\bin\\Debug\\net6.0","FileName":"obs64.exe"},{"Name":"OBS 2
","Location":"C:\\Users\\aaron\\RiderProjects\\JSONPatchIssue\\JSONPatchIssue\\bin\\Debug\\net6.0","FileName":"obs64.exe"}]}

Expected output from broken patch file:
{
  "$id": "1",
  "Applications": {
    "$id": "2",
    "$values": [
      {
        "$id": "3",
        "Name": "OBS",
        "Location": "C:\\Users\\aaron\\RiderProjects\\JSONPatchIssue\\JSONPatchIssue\\bin\\Debug\\net6.0",
        "FileName": "obs64.exe"
      },
      {
        "$id": "4",
        "Name": "OBS 2",
        "Location": "C:\\Users\\aaron\\RiderProjects\\JSONPatchIssue\\JSONPatchIssue\\bin\\Debug\\net6.0",
        "FileName": "obs64.exe"
      }
    ]
  }
}

The issue isn't with the library, it's with the data you're giving it.
testApplication.ToJsonDocument(SerializerOptions).RootElement

generates a document with the $id and $values properties in order to tell the subsequent deserialize how to properly align instances. (MSDN documentation)  Here's the difference:
// without preserve
{
  "Applications": [
    {
      "Name": "OBS",
      "Location": "C:\\projects\\json-everything\\JsonPatch.Tests\\bin\\Debug\\net5.0",
      "FileName": "obs64.exe"
    }
  ]
}

// with preserve
{
  "$id": "1",
  "Applications": {   // this is an object now
    "$id": "2",
    "$values": [
      {
        "$id": "3",
        "Name": "OBS",
        "Location": "C:\\projects\\json-everything\\JsonPatch.Tests\\bin\\Debug\\net5.0",
        "FileName": "obs64.exe"
      }
    ]
  }
}

Here's the patch that is generated:
[
  {
    "op": "add",
    "path": "/Applications/1",
    "value": {
      "Name": "OBS 2",
      "Location": "C:\\projects\\json-everything\\JsonPatch.Tests\\bin\\Debug\\net5.0",
      "FileName": "obs64.exe"
    }
  }
]

You can see that the patch would apply to the second document as expected, but the different structure of the first document causes the unexpected result.
patch.Apply(JsonElement) has no knowledge that an object was serialized this way or that the JSON you're giving it resulted from a serialization at all.  All it knows (and all it can know) is that you're giving it some JSON to modify.


No unit tests

I would like to see unit tests written in rescript, and also generate the coverage report

You may checkout here for the time being.


homebridge logger enhancements

Current Behavior
I love the coloured log and error output of homebridge.  However, I'm typically running homebridge through systemctl on my Raspberry Pi and through launchctl on my mac server.  As these kind of setups redirect output to a file or to syslog, the colours get lost.  Also, as syslog already provides a timestamp, the timestamp output by homebridge seems redundant in that case.
Suggested Behavior
I would like to be able to force colours in the output, regardless whether it's connected to a terminal, very much like homebridge-config-ui-x does.  I've been playing around with chalk and it seems that setting chalk.enabled to true and chalk.level  to 1 will do the trick.  When checking syslog with journalctl -a, the colours are displayed correctly.
I would like to be able to suppress the timestamps created by homebridge.
I don't think it's feasible for homebridge to detect how it's been launched, so I think the best way to achieve this is to introduce two additional command line options to homebridge: one to force colours, and one to suppress timestamps.
What are your views on this?  If you think this makes sense, I'll be happy to prepare a PR for this.

Sounds good

On Jun 3, 2018, at 4:19 AM, Erik Baauw<EMAIL_ADDRESS>wrote:
Current Behavior
I love the coloured log and error output of homebridge. However, I'm typically running homebridge through systemctl on my Raspberry Pi and through launchctl on my mac server. As these kind of setups redirect output to a file or to syslog, the colours get lost. Also, as syslog already provides a timestamp, the timestamp output by homebridge seems redundant in that case.
Suggested Behavior
I would like to be able to force colours in the output, regardless whether it's connected to a terminal, very much like homebridge-config-ui-x does. I've been playing around with chalk and it seems that setting chalk.enabled to true and chalk.level to 1 will do the trick. When checking syslog with journalctl -a, the colours are displayed correctly.
I would like to be able to suppress the timestamps created by homebridge.
I don't think it's feasible for homebridge to detect how it's been launched, so I think the best way to achieve this is to introduce two additional command line options to homebridge: one to force colours, and one to suppress timestamps.
What are your views on this? If you think this makes sense, I'll be happy to prepare a PR for this.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub https://github.com/nfarina/homebridge/issues/1882, or mute the thread https://github.com/notifications/unsubscribe-auth/AS5CmDv2_z4aOu2FDx-eHrbFmSMml0lwks5t45v_gaJpZM4UX_jT.

in the same idea, that would be nice to have a -no-qrcode parameter to hide the qr code in the logs


Added Mentions

Added the ability to use mentions in the sendMessage object so that a bot can ping specific people.
Main issue is that tag location is determined with indexOf which is a bit scrappy. It provides a good balance of ease of use as the tag text can just be passed in, instead of the user having to figure out where the tag is in the string themselves. Can be changed to also explicitly take in beginning + ending index of the string as well.

Awesome work @MikeShi42
What do people think about an optional fromIndex like is offered by javascript's indexOf operator?  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf
It could default to 0 and that way people still have all the power they need just in case.

Also: Is there any verification of input we should be doing?  i.e. checking if msg.body.indexOf(tag) is -1 and if so calling the callback with an error?  I'd probably prefer this to returning some generic facebook error.

@Schmavery we can def do some client side checking as well (sorry the code is hackish). It seems like FB will happily take the invalid input and just toss it out when rendering in terms of errors, it would be nice for the library to tell the user that their mention is 'invalid'. As for the fromIndex, are you thinking of it being an optional property in the passed in object? It seems like a good idea, and along that lines we can also include a toIndex for more flexibility.
Additionally, how do you feel about the documentation? I know the API I've created is a bit bulkier than other fields so I had some trouble trying to explain it well and just attached an example which hopefully would clear things up.

I think the example works well for docs.  You can make a note in the description of the field to see below for an example (bonus points for making it link).
I think it makes sense to just add the fromIndex (toIndex is not really necessary and doesn't match the signature of indexOf).  Adding it as an optional field in the passed in objects (default = 0) would be great.
Yeah basically some error or warning when msg.body.indexOf(tag, fromIndex) < 0 or something would be great.

Thanks @MikeShi42 !


Fix clean package script

Adjust order of clean’s commands, currently it only works if eachdir is globally installed (because it gets removed in the first step)

oh, should we add https://www.npmjs.com/package/eachdir as dev dependency?

Yeah it's already a dev dependency, just that it was being removed in the deletion of the main node_modules directory 😅
Sent from my iPhone

On 27 Feb 2018, at 13:15, Kiko Beats<EMAIL_ADDRESS>wrote:
oh, should we add https://www.npmjs.com/package/eachdir as dev dependency?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

ahhh, lol, now I understood the change 😂


GH-41349: [C#] Optimize DecimalUtility.GetBytes(SqlDecimal) on .NET 7+.

What changes are included in this PR?
Adds code to avoid an allocation when converting from SqlDecimal to Decimal128.
Adds a .NET 8 target to Apache.Arrow.csproj (to enable the optimization) and to Apache.Arrow.Tests.csproj (to test the optimization).
Are these changes tested?
Yes.
Are there any user-facing changes?
No.
Closes #41349

GitHub Issue: #41349

Hmm... I guess I'll create a separate PR first to move the infrastructure to 8.0.x.

 May need to withdraw and resubmit.


Any plans to allow order models by visit count?

Great package, easy to integrate. I'm wondering if you have any plans to allow ordering model items by visit count?
being able to order by total visits as well as 24h, 7d and 14d would be great.

Good to know that you like this package and that it was easy to install. No, I didn't had any plans. But know I will make them ;).
I actually already have built this functionality inside a Laravel App (local development). This is the code that I'm using:
public function getMostPopularTopicsOfLast24Hours()
    {
        $topics = $this->_model->where('status', 'publish')->get();

        foreach ($topics as $topic) {
            $topic_courses = $this->courseRepository->getRecentCreatedCoursesBySubject($topic->slug);
            $topic->totalCourseVisitsOfLast24Hours = 0;

            foreach ($topic_courses as $topic_course) {
                $topic->totalCourseVisitsOfLast24Hours += $topic_course->last_24h_visits_count->number;
            }
        }

        $result = $topics->sortBy(function ($model) {
            return $model->totalCourseVisitsOfLast24Hours;
        })->reverse();

        return $result;
    }

The function will sort the available (status = publish) topics by most visited courses in the last 24 hours. It is not ready for production, because I think it is very slow. But it gets the job done.
I'm going to think about a flexible solution for this. If you got some ideas about it, please be my guest.

Hi, quick update:
I made some breaking changes! That's why this package is stil under v1.0.0.
What you can do as described in the README.md, is using the sortBy method on a collection.
Here's an example:
$articles = Article::all()->sortBy('page_visits_14d');
$articles = Article::with('relatedModel')->get()->sortBy('page_visits_7d');
$articles = Article::where('status', 'published')->get()->sortBy('page_visits_24h');

ps: don't forget to run composer update


Cannot interact with local private network

Bug
I'm facing some issues while trying to interact with the private network. I implemented different clients using pyota and @iota/core, but I couldn't get node information. However, I don't have a problem if I interact with the devnet or with the private network through the browser. Are these libraries compatible with API version 2? If not, could you please suggest to me a working library?
To Reproduce
api = Iota("localhost:14265")

basicConfig(level=DEBUG)

# Get a new logger derived from the root logger
logger = getLogger(__name__)

# Attach the logger to the adapter
api.adapter.set_logger(logger)cloud

print(api.get_node_info())

Expected behavior
Node information
Environment information:

OS: [e.g. Ubuntu 18.04]
RAM: [e.g. 16 GB]

Additional context
This is the error I get:
iota.adapter.BadApiResponse: 404 response from node: {'error': {'code': '404', 'message': 'Not Found, error: code=404, message=Not Found'}}

Hey!
These libs are not compatible with the upcoming version yet.
Either you use the current mainnet branch, or you need to use another lib like (iota.rs)[https://github.com/iotaledger/iota.rs/tree/develop]

I think this can be closed for now.


svelte-package should add dist to ignore files

Describe the bug
In a SvelteKit library project, the files generated in the dist/ directory after the build are not ignored running pnpm lint.
Reproduction

pnpm create svelte@latest

add TypeScript syntax, add ESLint

cd myproject
pnpm i
touch src/lib/Foo.svelte
pnpm build && pnpm lint

Logs
><EMAIL_ADDRESS>lint /tmp/repro
> eslint .

/tmp/repro/dist/Foo.svelte.d.ts
   7:32  warning  Unexpected any. Specify a different type                                                                                @typescript-eslint/no-explicit-any
   8:4   error    Don't use `{}` as a type. `{}` actually means "any non-nullish value".
- If you want a type meaning "any object", you probably want `object` instead.
- If you want a type meaning "any value", you probably want `unknown` instead.
- If you want a type meaning "empty object", you probably want `Record<string, never>` instead.
- If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead  @typescript-eslint/ban-types
  19:36  warning  Unexpected any. Specify a different type                                                                                @typescript-eslint/no-explicit-any
  21:12  error    Don't use `{}` as a type. `{}` actually means "any non-nullish value".
- If you want a type meaning "any object", you probably want `object` instead.
- If you want a type meaning "any value", you probably want `unknown` instead.
- If you want a type meaning "empty object", you probably want `Record<string, never>` instead.
- If you really want a type meaning "any non-nullish value", you probably want `NonNullable<unknown>` instead  @typescript-eslint/ban-types

✖ 4 problems (2 errors, 2 warnings)

 ELIFECYCLE  Command failed with exit code 1.

System Info
System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 20.5.0 - ~/.local/share/pnpm/node
    npm: 9.8.0 - ~/.local/share/pnpm/npm
    pnpm: 8.6.11 - ~/.local/share/pnpm/pnpm
  Browsers:
    Brave Browser: <IP_ADDRESS>
    Chrome: 114.0.5735.198
  npmPackages:
    @sveltejs/adapter-auto: ^2.0.0 => 2.1.0
    @sveltejs/kit: ^1.20.4 => 1.22.4
    @sveltejs/package: ^2.0.0 => 2.2.0
    svelte: ^4.0.5 => 4.1.2
    vite: ^4.4.2 => 4.4.8

Severity
annoyance
Additional Information
No response

Just tested this locally and it doesn't seem to be an issue anymore


Proxy-pallet: Design Edit project flow

All fields from a project are editable.

[x] Allow administrators to modify any field
[x] Fix typos
[x] Update flow due #207
[x] Update functions/extrinsics

Backend done.
@tlacloc


Migrate API and 'ts-node/register'

When I npx knex migrate:latest from CLI, I get the following, because the knexfile has the .ts extension:
Requiring external module ts-node/register
Batch 1 run: 6 migrations

How do I get this same behavior when using knex.migrate.latest()? I'm getting:
Error: SyntaxError: Unexpected token 'export'

By running your file calling it with ts-node.

@kibertoad hmm, it's a globalSetup.js called by Jest.

Are you using swc-node/jest or ts-jest? If not, you should.

But generally I would advise running migrations as a part of npm pipeline and not via Jest hook.

Not sure if migrations can be a part of the npm pipeline since Jest creates a test database, then migrates, then destroys the test database.
Installed and configured jest to use ts-jest: preset: 'ts-jest' in my jest.config.js config. I'm still getting this:
Error: SyntaxError: Unexpected token 'export'

I don't think that is related though? knex.migrate.latest() still isn't utilizing ts-node like you explained. Not really sure how to fix this.

please share your jest config.
and on db side - I would recommend creating, migrating and destroying db outside of jest too.

//jest.config.js
module.exports = {
  testEnvironment: 'node',
  setupFilesAfterEnv: ['jest-extended'],
  globalSetup: '<rootDir>/testing/globalSetup.ts',
  globalTeardown: '<rootDir>/testing/globalTeardown.ts',
  preset: 'ts-jest',
};

// globalSetup.ts
import knex from 'knex';
import config from '../src/config';
import knexfile from '../knexfile';

const foo = async () => {
  const knexConfig = { ...knexfile };
  delete knexConfig.connection.database;
  const db = knex(knexConfig);

  try {
    await db.raw(`drop database if exists ${config.testDatabase}`);
    await db.raw(`create database ${config.testDatabase}`);
  } catch (error: any) {
    throw new Error(error);
  } finally {
    await db.destroy();
  }
};

const bar = async () => {
  const knexConfig = { ...knexfile };
  knexConfig.connection.database = config.testDatabase;
  const db = knex(knexConfig);

  try {
    await db.migrate.latest();
  } catch (error: any) {
    throw new Error(error);
  } finally {
    await db.destroy();
  }
};

export default async () => {
  try {
    await foo();
    await bar();
    console.log('\n\nTest database created successfully\n');
  } catch (error) {
    console.log(error);
    process.exit(1);
  }
};

// migrations/initial.ts
export const up = (knex) => (
  knex.schema.raw('create extension if not exists citext with schema public'));

export const down = (knex) => knex.schema.raw('drop extension if exists citext');

@onosendi Aren't you missing the transform param? Here is an example of jest that we are using on one of our projects:
  "moduleFileExtensions": [
    "ts",
    "js",
    "json"
  ],
  "testMatch": [
    "<rootDir>/src/**/*.(spec|test).ts|tsx",
    "<rootDir>/test/**/*.(spec|test).ts|tsx"
  ],
  "transform": {
    "^.+\\.ts$": "ts-jest"
  },
  "testEnvironment": "node",
  "reporters": [
    "default"
  ],
  "coveragePathIgnorePatterns": [
    "<rootDir>/node_modules/",
    "<rootDir>/coverage/"
  ],
  "globals": {
    "ts-jest": {
      "diagnostics": false
    }
  }
}

Does preset already include that?

Still the same error. knex.migrate.latest() is trying to use CommonJS.

Hmm, changing my migration to use CommonJS exports, I get an error not liking : in my code, which I think means is the file isn't getting transformed like it should.


Disabling the "Unknown Command" message

Hello,
I am new to this commando thing so I would like to disable the "Unknown Command" message, is this possible?
Thanks for your time,
Cake

What? I cannot disable nor replace it.
index.js:
const path = require('path');
const { CommandoClient } = require('discord.js-commando');

const client = new CommandoClient({
  owner: '[hidden]',
  commandPrefix: 'ns'
});

client.registry
  .registerDefaultTypes()
  .registerDefaultGroups()
  .registerDefaultCommands({
    unknownCommand: false
  })
  .registerCommandsIn(path.join(__dirname, 'commands'));

commands/util/unknown-command.js:
const { Command } = require('discord.js-commando');

module.exports = class UnknownCommandCommand extends Command {
  constructor(client) {
    super(client, {
      name: 'unknown-command',
      memberName: 'unknown-command',
      group: 'util',
      description: `Provides friendly feedback when unknown command is requested`,
      unknown: true,
      hidden: true
    });
  }

  run(message) {
    message.react('❔');
    return message;
  }
};

Please guide me on what am I doing wrong?


Avoid fetching an rebuilding git gems when it's not necessary

Kind of a followup to https://github.com/bundler/bundler/pull/4272
The issue
As demonstrated by the updated test case, whenever a gem is changed (even a non-git one), bundler re-fetch all git gems, and recompile their extensions (if any).
You can repro that issue by running the modified git_spec.rb against master.
The proposed fix
In that patch I simply make Source::Git skip the fetch step if the cached_revision matches the install path.
Since install_path uses only the first 10 characters of the full revision, there is a very very small chance of a collision happening, but It's so small that I think it can be ignored.
However my understanding of the codebase is too limited to be 100% sure the git gem would be properly updated if it's definition (branch / ref / etc) is updated. I tried to write a test case for this but couldn't figure out how to create a repo with multiple revisions. I'll keep digging, but I figured I might as well ask for feedback at this stage.
@segiddins any thoughts on this ? (since you fixed #4272), any pointers on how to better test this?
cc @rafaelfranca @jules2689

I have no idea why travis choked, by I hope you dont mind me adding some tests ;)

@bundlerbot r+

🎉 thanks a lot for improving the coverage !


Use Cargo.toml lint fix instead of build.rs

https://github.com/smol-rs/event-listener/pull/135#discussion_r1606080083

Thanks! Could you remove the build script?


Delete session?

Sorry if I'm being blind or an idiot, but I can't seem to find an option to delete a session. If it doesn't exist, would it be possible to add it or give instructions on how to manually delete a session?

That button is simply not there for me, I'm trying to remove the 2h 46m session:

@Lacro59

playnite-gameactivity-plugin_3_0_1.zip

Thanks, this has fixed it for me


The Mir compiler failds to compile the benchmarks

Ok, first of all! Great work with the benchmark script! It indeed finds and uses all of my installed C compiler! Good for thinking and implementing it! However, unfortunately, it seems that the mir compiler doesn't work. At least in the "bbv" and for the first 3 tests I tried (because I stopped it after that to post this issue).
Also, could you please add some info about what each column represents? The first one is the compiler but what about the other two? The second is a time but what? The time it took to run the test or the time to compile? In case it is runtime, please could you also count compile time and add another column (or two)? Also, in what? In seconds, milliseconds, microseconds? And the third a times counter but compared to what? As "GCC -O2" is always 1.00x (at least for the 3 tests that I run), I suppose that you initialize the "fastest" time in the GCC version so the other version will check how much of its performance they have (eg. 0.50x is 50% of the GCC performance).
But all these are just theories so please, have the first line explain the columns. Thank you!

Also, I think you should remove "GCC -O0" because I don't think that it really helps. Sure, it can be used for comparison to see the less optimized vs the most optimized version but people always care and compare the most optimized version so I think that "GCC -O0" just wastes space. But just a suggestion, I don't really mind on that one!

REEE, Wait! I wanted to read the script file and try to fix it myself and I found out that you use "./c2m" to run the mir bench. Why is that? There will be no local "c2m" executable in the "c-benchmarks" directory. It should be expected that the user installed it in the PATH and that it works.
So I "fixed it" (not really cause it wasn't broken, lol). I have also changed the tests a little bit to some other that make a little bit more sense? Do you want me to upload it? However, I haven't changed the columns and didn't added compile time benchmarks yet (because I don't know shell scripting and I couldn't understand a lot in the file...).
And finally... WHY (and) IS MIR FASTER THAN GCC AND CLANG (not always of course but still)???
I would wait for your reply first before I close this issue.

Thank you for your feedback.  The script prints wall time of running benchmarks compiled by different compilers.  The second column is generated code performance relative to GCC -O2.  I've just checked and found that benchmarks are working for me on bbv branch on x86-64 machine.  But I should acknowledge that bbv branch can be unstable sometimes. Currently I use it for myself to experiment on my own JIT.  I will start the branch stabilization after Sept to release MIR based on this branch at the end of year.
Benchmarking GCC -O0 is important for me too as I want to keep better compilation and generated code performance than GCC -O0.  To be honest I am not satisfied with c2m and mir generator speed.  Recently I sped up RA but mir generator speed is still small for my taste.  The problem is that MIR as internal representation is not compact.  Originally it was designed mostly to simplify API and implementation of code generation.
9th test (calls) is slow because all calls in MIR are currently done through thunks.  The next release will have option to call generated function directly.  It will improve 9th benchmarks.
Tests 0 (array), 11 (sieve), 12 (nbody), 13 (spectral norm) requires loop optimizations, better alias analysis, and/or better dealing with global variable addressing to be improved.  I guess MIR generated code will look better if benchmarks are more memory bound.  For example, I can change sieve to another variant (with bigger array) and mir generated code performance will achieve 90% of GCC -O2.
In any case optimization work is very time consuming and I am currently can not spend much time on it although this work is very interesting for me especially finding a good balance of generation speed, generation code performance, and simplicity of optimization implementation (which affects generator reliability as the more code you have, the more bugs is in the code).

Thanks for the fast reply!

I've just checked and found that benchmarks are working for me on bbv branch on x86-64 machine

But how? Is there a local "c2m" executable in the "c-benchmarks" directory? There isn't in my case. Is there something I'm missing?

But I should acknowledge that bbv branch can be unstable sometimes. Currently I use it for myself to experiment on my own JIT

Yeah, I remember that you said that somewhere else. However, I want to ask something very important. Is bbv unstable and buggy even in things and features that also exist in the master branch or do they have the same stability for the same features? I'm asking that because I would like to use bbv as nothing is fully stable anyway and as you're going to merge it. So when I find bugs in bbv, should I create issues?

Benchmarking GCC -O0 is important for me too as I want to keep better compilation and generated code performance than GCC -O0.

Oh, I see! I run benchmarks and the results were the following:
============AVERAGE:=========
c2m -eb:                                              0.82x
c2m -eg:                                              0.82x
gcc -O0:                                               0.50x
gcc (fastest):                                        1.00x
============GEOMEAN:=========
c2m -eb:                                              0.74x
c2m -eg:                                              0.74x
gcc -O0:                                               0.38x
gcc (fastest):                                        1.00x

My CPU is "Ryzen 5 2400G" and the flags for gcc (fastest) are the ones I mentioned in my issue (-Ofast, -inline, etc.). So amazing results!

To be honest I am not satisfied with c2m and mir generator speed. Recently I sped up RA but mir generator speed is still small for my taste.

From one point, I LOVE the way you say that and the fact that you have higher expectations but I want to ask another things. From the logical point of view, how possible is this? Like I said, in my benchmarks, mir is already at least 83% of runtime performance of "GCC -O2". So, I really wonder! Do you just have higher expectations anyways or do you think that you can practically get a good runtime performance boost without sacrificing a lot of compilation speed (so the trade is worth it)? That's an interesting topic for me as I don't know how neither mir as the mir binary format work internally so I don't know what's possible and what are the limitations. But you sure make me excited!

The problem is that MIR as internal representation is not compact. Originally it was designed mostly to simplify API and implementation of code generation.

I don't understand, what do you mean when saying "compact" and how would that help making things better? Also, have you thought about changing the design at something you prefer more? As mir hasn't hit version 1.0 yet, I thinking breaking compatibility is not something you should worry about.

9th test (calls) is slow because all calls in MIR are currently done through thunks. The next release will have option to call generated function directly. It will improve 9th benchmarks.

Why will it be an option and not be changed at all? Are there any drawbacks?

Tests 0 (array), 11 (sieve), 12 (nbody), 13 (spectral norm) requires loop optimizations, better alias analysis, and/or better dealing with global variable addressing to be improved. I guess MIR generated code will look better if benchmarks are more memory bound.

They way you make it seen is that if you implement these, mir will reach 100% of GCC's performance and that's just crazy! Well, there are cases where you can solve problems without recursion however there are cases where recursion is either necessary (is that truly? That's what I heard. Never found any in my experience) or it makes things much much easier. So I suppose "loop optimizations" are something you may be interested. Not sure about the other two and how much the trade off between the compile times and runtime performance will worth it but in the end, you are the creator and you know better than me! And anyways, mir now compiles at least 5 times faster than GCC -O2 in a project that I tested out so its amazingly fast and losing some speed won't hurt! Tbh, even if it was 2 times faster I would still be happy!
In then end, I'm saying again that I find your work phenomenal! I like that you have high expectations for your project (that's how I think for mine as well so I love that way of thinking) and that you are interested in improving it. In any case, have fun and don't overdo it (I mean working)! You shouldn't be in hurry. I think, if you want to take put into priority, try to fix as many bugs as possible and then try to implement inline assembly (with a system that allow us to use variables and its not annoying like GCC's one) or at least an insns that allow us to do system calls. The second one will probably be much much easier and its more important tho. But in any case, optimizations can wait in my humble opinion! But again, you know better in the end!


Fix : Android - Picture looks smaller in Preview page

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/7591
Tests

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

QA Steps

1- Launch the app
2- Log in with any account
3- Tap on any user
4- Tap on plus button and add attachment
5- Tap on Select from Gallery
6- Attach any picture from Gallery
7- Tap Send
8- Tap on attachment again

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

Tested On

[ ] Web
[ ] Mobile Web
[ ] Desktop
[x] iOS
[x] Android

Screenshots

Web

Mobile Web

Desktop

iOS

Android

Can we test on all platforms? Thanks!

I think the issue was reported on android only and I do fix it for native.
I catch this issue on the web also. do I need to search for a new fix since the web has another way to handle image preview ?  or can I report it as a new issue?

@ahmdshrif let's try to fix it for web too

On the web, you can just click and this will do the zoom we expect

If the bug doesn't happen on main, then this PR broke it. All issues need to be fixed across all platforms.

the web bug is on main too

ok, working on a web and desktop fix.

I add zoom to be true as the default value on the web.
and it does what we expect.
https://user-images.githubusercontent.com/21364901/153286953-4fa4866f-6255-4ceb-875f-4ea7fdf63286.mov

As long as it doesn't cause a regression, that's fine.

@ahmdshrif all images on web are zoomed in by default. Let's fix that

@rushatgabhane  I think that is what we expect.  the small image does not fill the screen so we zoom it by default to take the screen width.
or what do you mean

@ahmdshrif an image that isn't small is zoomed by default.
https://user-images.githubusercontent.com/29673073/153295466-023bdcf0-a8e3-4739-8ec9-0cedb1c5d493.mp4

ok get it will fix that , thanks

I get this error when trying to run on the desktop is this my local issue or is this issue on the main.
[Renderer] [HPM] Error occurred while trying to proxy request /api?command=Log from localhost:8080 to http://[::1]:9000 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[Renderer] [HPM] Error occurred while trying to proxy request /api?command=Log from localhost:8080 to http://[::1]:9000 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

@ahmdshrif desktop is working fine for me.

it shoud be fix now @rushatgabhane

ok, thanks for your feedback I will take some time thinking about a more stable way for the web.

@rushatgabhane  it's now stable and we can zoom the small image also.
preview :
https://user-images.githubusercontent.com/21364901/153758109-ef4a51b2-4f22-47fe-9dcf-154267fd637b.mov

@rushatgabhane  I find the last 2 edge cases. and now fixed.
1- when image is loaded faster (with cache enabled) and the container with still  0 we can't resize since the setImageRegion is called one time.
solve this by calling it also when the layout changes.
2- when the width is large than the height the image has fit the screen.
so I chose the aspect ratio deepened on min of ratio container width/image width, and container height/ image height.

@ahmdshrif Thanks for noticing that!
But after your latest commit, attachment preview isn't working for me anymore. It just shows a white screen

Also, try out this case -

Reduce the window size.
Open a wide image. (It has to fit the attachment preview)
Zoom in.

Expected: Image zooms in
Actual result: Image doesn't zoom in. Because newZoomScale = 1

@rushatgabhane I think all edge cases are fixed now. 😃

sorry for that but it looks like the app gets cache on my side because only  I ask review when all these cases work with me.
I reproduce these issues when I rerun the project and IDK but the code is not flexible to change. any change in a position makes a new issue. not like native which uses more stable code.
I have some work around these issues and will work like this video
what do you think about the behavior on video
https://user-images.githubusercontent.com/21364901/154157027-9d2a2c4f-3d7b-4cae-8a75-d4edb1d608ff.mp4

sorry for that but it looks like the app gets cache on my side because only I ask review when all these cases work with me.

@ahmdshrif That's understandable. Thanks!

I reproduce these issues when I rerun the project and IDK but the code is not flexible to change. any change in a position makes a new issue. not like native which uses more scalable code. what do you think about the behavior on video

Ohh I see. What do you think of creating a function which just zooms in the image by two times?
Image fits the attachment view, just need to fix zoom. And I think implementing zoom from scratch would be faster than modifying the current code.
Thoughts?

I try many things here if we try to change the image size from state or add a  static zooming scall (2 for example ) . or change size form style
we get issues with scrolling and centralization.
some time image going to most left.
sometimes you can't scroll to the end of the image.
trying again to fix this I get stuck in many issues. do you think I must continue to fix all these issues or we can move the zooming to another one?
if we try to do zooming on production for this image for example we note this does not fit the screen width and does not have a specific ratio of zooming.  but the puppy image for example can fill screen width .
this is an example of an existing zooming  bug
https://user-images.githubusercontent.com/21364901/155025218-968e544c-05cf-4211-afd3-5fbf0d22e06c.mov
also if you can make the image equal the container height and width on production it will not be zoomed. at all.

I try many things here if we try to change the image size from state or add a static zooming scall (2 for example ) . or change size form style

@ahmdshrif thanks for your time!

do you think I must continue to fix all these issues or we can move the zooming to another one? also if you can make the image equal the container height and width on production it will not be zoomed. at all.

Yeah, I didn't think this through. Zooming isn't perfect on production, do you mind reporting this on slack as a feature request?

ok, thanks @rushatgabhane.  I am checking now the white screen since I am not reproducing it any time just get the zooming issue.

this is the zooming issue in production I capture the layout size by log it on development and resizing the image to layout size and testing it on production and that is what happens now.
is this a feature request or bug?
https://user-images.githubusercontent.com/21364901/155198537-9ee549e3-0050-4ac5-8cef-d1cde256d07e.mov

@rushatgabhane  you can test it now but please disable the cache when testing.
I just add one point here which I only resize the small images. so we do not affect the big image zooming.
also, add 0.95 * aspect ratio to have some space the image can zoom in as a workaround until the zooming gets fixed. (i think this is better for now)

you can test it now but please disable the cache when testing.

@ahmdshrif I disabled cache, tried incognito and hard refresh. But I'm still facing this white screen bug 😅

@rushatgabhane  I catch an edge case. where the image going to most left. (outside the screen )   I hope this is the same error you have.
I fix it and test it in many images size with and without cache enable.
and on chrome and safari.
and work fine.
also, there are some cases I think can happen also do some changes to handle it.
https://user-images.githubusercontent.com/21364901/155322991-fd025c1e-6962-486f-91f7-1e93a32afa71.mov

if you still have the issue I hope you give me more info about it.
if it is related to a specific browser. of specific image size.
that will help me to  repro it

@rushatgabhane  the image flicker happens in case the container still does not load and his dimension is  0 and the image has dimension (maybe from cache).
I fix that by waiting until the image and container get loaded and then resizing it.

@rushatgabhane
umm ...try this and not get a white screen.
something can help us: -
do you have an error on the console that you can share with me?
can you change the browser?
can we ask the  QA team help us to repro this? I can't solve this if I can't repro it.
https://user-images.githubusercontent.com/21364901/155940734-6aa81ec0-8d38-491d-acdc-6865b86ca61a.mp4

@ahmdshrif apologies! I messed up the git merge. It's working fine now, thank you for the quick response!

np @rushatgabhane 😃
thanks

let's not use anonymous funcs inside render

@ahmdshrif I think you missed this 😅

I don't get that 😅
Can you please mention this anonymous function

@ahmdshrif oh, I meant the following arrow functions onLayout(), onPressIn(), onPress(), onPressOut(), onStartShouldSetPanResponder()
From Performance.md

Avoid using arrow function callbacks in components that are expensive to re-render. React will re-render this component since each time the parent renders it creates a new instance of that function. Alternative: Bind the method in the constructor instead.

Ok get it iam not add that just modifying it . But it's good point to prove the performance.
Thanks will do it now .

@rushatgabhane  it's done now

onLayout(), onPressIn(), onPress(), onPressOut(), onStartShouldSetPanResponder()

@ahmdshrif if we're going down this path, why not move rest of the functions too :)

@rushatgabhane Fine i do it for all functions now  .

: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.

🚀 Deployed to staging by @AndrewGable in version: 1.1.42-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

@ahmdshrif @AndrewGable @rushatgabhane PR is failing on <IP_ADDRESS> build
https://user-images.githubusercontent.com/93399543/158097177-cbb82089-2a45-4d62-a438-cbc20013c744.mp4

@kbecciv is this on mweb only ?

@ahmdshrif It fails on Andriod app.

ook, we can repro this issue with very small images only.  https://github.com/Expensify/App/issues/7591#issuecomment-1033022469
and this is one of the other edge cases we can't repro during the test. and need to be handled also.

@ahmdshrif wait what, I don't understand why this particular image isn't working while these are - https://github.com/Expensify/App/issues/7591#issuecomment-1033022469.
The image width and height is correct too
imageWidth = Math.round(this.props.windowWidth);
imageHeight = Math.round(imageWidth * aspectRatio);

Yeah but large images like this one - https://github.com/Expensify/App/pull/7660#discussion_r804253457 works

🚀 Deployed to production by @chiragsalian in version: 1.1.42-6 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

@rushatgabhane  yes this case is so weird

the update I have for now is this something related to android and how he resize the image
because the same code works fine on ios.
android gets stuck with an image with this size only but still works fine with other sizes.
I think the solution will be to change most of the code on the calculateImageSize  to make sure it's not going to this edge case for android.
is this something we should do here or can move it to a new issue?  @AndrewGable @rushatgabhane

@AndrewGable and @rushatgabhane - sorry to also ping you but we're at the 7 day payment timeframe. Is this new issue a regression that needs to be fixed before paying/closing this job?

@Christinadobrzyn this issue isn't completely fixed, I've asked @ahmdshrif to fix it here - https://github.com/Expensify/App/issues/7591#issuecomment-1075509057
We'll create a follow up PR, after which payment should be done.


Charts do not work with coinmarketcap

Is this expected?

Hmmm, I just realized the time range is too large. 1970 to 2008.

CoinMarketCap must have introduced breaking changes or made that particular endpoint obsolete.
PRs are welcomed in go-coinmarketcap repo


can't build on android

Hey guys, I'm having an issue building this for Android (iOS seems to work fine). my package.json looks like:
    "react": "16.0.0-alpha.12",
...
    "react-native": "^0.46.4",
...
    "react-native-maps": "^0.15.3",

when I run react-native run-android however, I get the following error:
Script 'PROJECT_DIR/node_modules/react-native-maps/lib/android/gradle-maven-push.gradle' line: 43

* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-maps'.
   > Failed to notify project evaluation listener.
      > gradle_maven_push_ajdkud73yn42oc9wixuxzv1mx$_run_closure1$_closure2```

What installation steps did you follow? Did you do manual setup or use link?
What's on gradle-maven-push.gradle' line: 43?

I used link. Weird thing is I've just tried it again and it works without any changes. Only thing different was that I closed down Android studio..


resolve vulnerabilities in dependencies

In particular, gulp and gulp-eslint seem to still be dependent upon vulnerabilities.
Try these approaches:

delete package-lock.json, then re-install
take a note of all dependencies, then remove them all from package.json. Remove package-lock.json then run npm install <package-list>. This will enable npm to determine the latest dependencies and hopefully pisk up the latested and hopefully fully fixed versions of all dependencies.

Here is the vulnerability profile:

gulp-mocha (3 mod)
gulp-eslint (3 mod)
gulp (7 high)

gulp example: gulp-sass-bootstrap-boilerplate

It maybe that npm audit is reporting problems that pught not to be, see this: npm audit broken by design

Just added an audit task that nbly checks for production vulnerabilities. This is a non issue.


User ID on final page of survey should be required

Don't allow users to bypass this leaving the username empty -- this should be a required field.

Change the response prompt from "Please enter your username" to  "Enter Your Amazon Turk Worker ID"

This is already a required field in the form. It cannot be required on the survey instance because the survey instance is created earlier to handle the responses. There are a couple of things we can do:
eliminate all surveys that don't have a username. This would be easy to implement - we could have a "delete all incomplete surveys" on the stats page. The risk here is the possibility that a turker is mid-survey in which case their instance will disappear and they will probably get an error condition.
Alternatively: require the username up front instead of the end. The problem with this is that the presence of a username is no longer an indicator of survey completion.

Since there is no back button, how could a turker be mid survey when they
are entering their id? They should be at the end?
Chris J. Vargo
University of Alabama
Assistant Professor, Ph.D.
Advertising & Public Relations
[image: Twitter] http://www.twitter.com/chrisjvargo [image: LinkedIn]
http://www.linkedin.com/in/chrisjvargo [image: Google Plus]
https://plus.google.com/105471295838192826025 [image: WordPress]
http://www.chrisjvargo.com/
On Thu, Jul 16, 2015 at 11:47 AM, Scott Bradley<EMAIL_ADDRESS>wrote:

This is already a required field in the form. It cannot be required on the
survey instance because the survey instance is created earlier to handle
the responses. There are a couple of things we can do:
eliminate all surveys that don't have a username. This would be easy to
implement - we could have a "delete all incomplete surveys" on the stats
page. The risk here is the possibility that a turker is mid-survey in which
case their instance will disappear and they will probably get an error
condition.
Alternatively: require the username up front instead of the end. The
problem with this is that the presence of a username is no longer an
indicator of survey completion.
—
Reply to this email directly or view it on GitHub
https://github.com/scott2b/surveyor/issues/3#issuecomment-122017580.

The ID is at the end. It is the last thing to submit after all responses.

Right, so I think option #1 works. I don't understand how "a turker is
mid-survey in which case their instance will disappear" if they are
entering the ID at the end
Chris J. Vargo
University of Alabama
Assistant Professor, Ph.D.
Advertising & Public Relations
[image: Twitter] http://www.twitter.com/chrisjvargo [image: LinkedIn]
http://www.linkedin.com/in/chrisjvargo [image: Google Plus]
https://plus.google.com/105471295838192826025 [image: WordPress]
http://www.chrisjvargo.com/
On Thu, Jul 16, 2015 at 11:51 AM, Scott Bradley<EMAIL_ADDRESS>wrote:

The ID is at the end. It is the last thing to submit after all responses.
—
Reply to this email directly or view it on GitHub
https://github.com/scott2b/surveyor/issues/3#issuecomment-122019425.

Oh, the instance is created when you start a survey, not finish it. This is necessary because the responses need to be attached to an instance. So if there are 5 pages in a survey and somebody is on page 3, they have not entered their ID yet -- so if we delete all instances with blank IDs then the instance they are working on will disappear. When they submit page 3 to go to page 4, my guess is that there will be a key error.

OK - That makes sense.
Can we create a condition like this?
If an instance is over two hours old:
If a instance has a blank username:
delete instance
Chris J. Vargo
University of Alabama
Assistant Professor, Ph.D.
Advertising & Public Relations
[image: Twitter] http://www.twitter.com/chrisjvargo [image: LinkedIn]
http://www.linkedin.com/in/chrisjvargo [image: Google Plus]
https://plus.google.com/105471295838192826025 [image: WordPress]
http://www.chrisjvargo.com/
On Thu, Jul 16, 2015 at 11:56 AM, Scott Bradley<EMAIL_ADDRESS>wrote:

Oh, the instance is created when you start a survey, not finish it. This
is necessary because the responses need to be attached to an instance. So
if there are 5 pages in a survey and somebody is on page 3, they have not
entered their ID yet -- so if we delete all instances with blank IDs then
the instance they are working on will disappear. When they submit page 3 to
go to page 4, my guess is that there will be a key error.
—
Reply to this email directly or view it on GitHub
https://github.com/scott2b/surveyor/issues/3#issuecomment-122021566.

Alternative idea that may be easier. What if we changed the reporting in
the stats page?
Filter out blank usernames from reporting here:
http://surveyor.beta.codeslick.com/survey/1/stats
Filter out everything but blank usernames here:
http://surveyor.beta.codeslick.com/survey/1/blanks
I'll go through and manually delete blanks from time to time.
Chris J. Vargo
University of Alabama
Assistant Professor, Ph.D.
Advertising & Public Relations
[image: Twitter] http://www.twitter.com/chrisjvargo [image: LinkedIn]
http://www.linkedin.com/in/chrisjvargo [image: Google Plus]
https://plus.google.com/105471295838192826025 [image: WordPress]
http://www.chrisjvargo.com/
On Thu, Jul 16, 2015 at 12:03 PM, Chris Vargo<EMAIL_ADDRESS>wrote:

OK - That makes sense.
Can we create a condition like this?
If an instance is over two hours old:
If a instance has a blank username:
delete instance
Chris J. Vargo
University of Alabama
Assistant Professor, Ph.D.
Advertising & Public Relations
[image: Twitter] http://www.twitter.com/chrisjvargo [image: LinkedIn]
http://www.linkedin.com/in/chrisjvargo [image: Google Plus]
https://plus.google.com/105471295838192826025 [image: WordPress]
http://www.chrisjvargo.com/
On Thu, Jul 16, 2015 at 11:56 AM, Scott Bradley<EMAIL_ADDRESS>wrote:

Oh, the instance is created when you start a survey, not finish it. This
is necessary because the responses need to be attached to an instance. So
if there are 5 pages in a survey and somebody is on page 3, they have not
entered their ID yet -- so if we delete all instances with blank IDs then
the instance they are working on will disappear. When they submit page 3 to
go to page 4, my guess is that there will be a key error.
—
Reply to this email directly or view it on GitHub
https://github.com/scott2b/surveyor/issues/3#issuecomment-122021566.

We could just make it so stats and reports only include surveys with IDs. Is there a reason you ever need to see surveys without IDs?

What if they might fill out a couple pages of tweets and then quit, and we
don't want that data in our reports? If that data wouldn't be included,
then I think you're right.
Chris J. Vargo
University of Alabama
Assistant Professor, Ph.D.
Advertising & Public Relations
[image: Twitter] http://www.twitter.com/chrisjvargo [image: LinkedIn]
http://www.linkedin.com/in/chrisjvargo [image: Google Plus]
https://plus.google.com/105471295838192826025 [image: WordPress]
http://www.chrisjvargo.com/
On Thu, Jul 16, 2015 at 12:11 PM, Scott Bradley<EMAIL_ADDRESS>wrote:

We could just make it so stats and reports only include surveys with IDs.
Is there a reason you ever need to see surveys without IDs?
—
Reply to this email directly or view it on GitHub
https://github.com/scott2b/surveyor/issues/3#issuecomment-122024768.


Add NATS module

Purpose
Fixes https://github.com/ballerina-platform/ballerina-lang/issues/13810
Approach
NATS producer and consumer was implemented to demonstrate the following messaging domains.

Point to point communication (Queues)
Pub/Sub (Topics)
Request/Reply

Samples
Producer
import ballerina/nats;
import ballerina/io;

public function main() {
        nats:Producer producer = new({ host: "localhost", port: 4222, clientId: "p0" });
        var result = producer->send("subject_foo", "Hello Ballerina !");
        if (result is error) {
                io:println("Error occurred while producing the message");
        } else {
                io:println("Message produced successfully");
        }
}

Consumer
import ballerina/nats;
import ballerina/io;

listener nats:Consumer subscription = new({ host: "localhost", port: 4222, clientId: "s0" });

@nats:ServiceConfig { subject: "demo" }
service demo on subscription {
    resource function onMessage(nats:Message msg) {
        io:println("Recived message : " + msg.getData());
    }
}

Remarks
Test cases will be addressed through https://github.com/ballerina-platform/ballerina-lang/issues/14668 as writing test cases for NATS would require spawning NATS streaming server docker images. This will be done as a part of testgrid effort.

We need to include the examples in the index.json file


can't apply if trying to remove worker_groups_launch_template

I have issues
I'm submitting a...

[x] bug report
[ ] feature request
[ ] support request - read the FAQ first!
[ ] kudos, thank you, warm fuzzy

What is the current behavior?
when trying to remove a worker_groups_launch_template can't apply, getting the following:
Error: Cycle: module.eks.random_pet.workers_launch_template[2], module.eks.random_pet.workers_launch_template[2] (destroy deposed 2ff3956f), module.eks.aws_launch_template.workers_launch_template[3] (destroy)
If this is a bug, how to reproduce? Please include a code sample if relevant.

create an eks instance like in /examples/launch_templates
delete a launch template out of the two
try to apply

What's the expected behavior?
should be able to remove a worker group
Are you able to fix this problem and submit a PR? Link here if you have already.
Environment details

Affected module version: 12.0.0
OS: linux/ mac
Terraform version:0.12.24

Any other relevant info

I have the same issue, but this is not the suggested way to manage old worker groups:
https://github.com/terraform-aws-modules/terraform-aws-eks/blob/master/docs/faq.md#how-do-i-safely-remove-old-worker-groups
The documentation suggest to set min/max node pool size to 0 and just leave the empty node pool.
Anyway I do agree that node group deletion handling would be a nice feature but from my (limited) knowledge of the project I guess that the fact that worker_groups_launch_template is handled as a list (shifting index problem) is a big limit for the implementation .


stack design issues

The rules' metric names (MetricName) are not unique. When multiple stacks are used metrics become unusable. Multiple stacks are necessary for CI/CD but also required sometimes because of the way flood protection works. Lambda code also reference these hard coded metric names
There is a similar problem with the bucket event. When trying to do an A/B deployment of the WebACL the bucket configuration will fail for the new stack because the id is not unique. The s3 trigger configuration id is hard coded to "Call Log Parser". It should be prefixed with the stack name or some other unique identifier
Almost everyone needs to customize the stack but while it is an excellent starting point there are many things to fix and this makes it really hard to merge changes. It is an excellent first incarnation but will require a redesign at some point to make it easier to customize and update.

I saw a pull request about that (PR#53). Good catch.
Set to be included in the next release.
Thanks!!

We've just pushed a new version that includes the PR#53.
Thanks!


Recent logins - multiple logins from the same IP address

Why will it show multiple logins from the same IP address?

Because those are different sessions.

Why will it create different sessions?
How long will the stay as Logged in? The user is not logged in 4 times. Shouldn't it detect that and change it to something else?

This could be due to multiple browsers or incognito windows on the same machine?

It seems that the user have used incognito, so that will probably explains it.


Need a proper README

Can you assign it to me?

Sure 👍

Alright! Can you provide me few keywords about the app so that I can make a well-structured Readme file?

Clean UI, localised music, download music. hosted 24x7 , no lag
Made with:

"react": "^17.0.2",
"react-redux": "^7.2.6",
"redux": "^4.1.2"
(It would be nice if you could add these as badges)

Features to be added:
Sort music, search, Spotify link, discord presence
Header:

If you need any more info, feel free to ask!

Hi! I have raised a pull request with the updated file.
Kindly see

Thanks, @ishaanbedi ! Keep up the good work!

@jessej-samuel Thank you! Looking forward to contributing more to the app...


TACO modifications for Database Impersonation

Hello,
I've been working with Tableau SE Nate Bernache. We've been trying to get database impersonation working for a common customer.  He's been troubleshooting this for a week on a Tableau server we gave him access to and has run out of ideas.  He said I should post this problem here. We've modified our TACO file according to your samples for Postgres with very little modification to establish a working baseline.  We can user a standard postgres connector with our product and routinely do with other products.
We modified the standard postgres sample with the connectionproperties.js files here:
https://github.com/tableau/connector-plugin-sdk/blob/master/samples/scenarios/templates/db_impersonation/connectionProperties.js
When we try to use the connector the user name published with the connection/dashboard is used and the JDBC username isn't passed in for a 'set role' command as expected.  Please let me know what logs or other detail you need for help.
For reference: https://github.com/tableau/connector-plugin-sdk/issues/961

Hi @cshrauder
In case of db-impersonation, we do not explicitly run a set role command. It is for the database to make sure database impersonation is going through. I think it will be wise to first figure out if postgres supports database impersonation. If it does, then maybe figure out what driver property needs to be set in place of DelegationUID.

@devanshsoni9
It appears impersonation via the DelegationUID variable was ported from Hive; however, I believe Postgres JDBC implements a set_role command.

Does the SDK support a "set_role" command?
If not, can you please provide guidance on how to leverage impersonation on other data sources besides Hive/Impala?
Are there other options/workarounds that we can explore to enable impersonation using username and password based on Postgres?

Thanks,
-Christian

You may look into enable Initial SQL capability and then use set_role in conjunction with [TableauServerUser] parameter as described in this article. I guess you may also want to defer execution to Tableau Server using the  defer tags.
Let us know if it's not working per your requirements.

Thanks!  Will be trying this out shortly.

Thanks, in our internal testing doing a SET ROLE [TableauServerUser]; Seems to work.  Will be testing this on the customer system but this appears to work.  Thanks for the guidance!

Thanks @cshrauder, Closing this out.


only accept string base64 or buffer for private key input

close #380
This PR fix the pure js lib to behave exactly the same as the wasm version regarding private key format.
Currently the pure js accept base64 or hex string or buffer as private key input. In wasm we removed the hex support after the audit to only accept as valid format base64 (which is standard in filecoin) or Buffer. This PR bring the same modification to the pure js lib.
Note: It is a breaking changes regarding the pure js. Maybe it will require bumping the version adequately.

There is a minor linter issue but apart from that it is ready to go!


Remove extra auth interceptor call.

remove extra auth interceptor call adding additional Bearer token.

Codecov Report

Merging #3041 (c3ccca6) into main (7354090) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #3041   +/-   ##
=======================================
  Coverage   65.77%   65.77%
=======================================
  Files         485      485
  Lines        9336     9336
  Branches     2157     2157
=======================================
  Hits         6141     6141
  Misses       3192     3192
  Partials        3        3

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7354090...c3ccca6. Read the comment docs.


[Feature]LS-1068 add onelink

Hello guys, miss clicked base branch and that happens ^^. Sorry for bothering. Will close this PR.