Unable to reuse current cart session.

Lunar version: 0.4.0
Laravel Version: 10.15.0
PHP Version: 8.1.10
Database Driver & Version:

Expected Behaviour:
CartSession::current() can be used multiple time.
Actual Behaviour:
I'm working on a local environment
When I add cartline to cart, All session data gets flushed. Unable to use the current cart again to add multiple items.
Steps To Reproduce:
After fresh installation
Created CartController (will be used for api call)
Route /cart
in index method
I do
function index(Request $request){
        $cart = CartSession::current();
        $purchasable = ProductVariant::where('id', 1)->first();
        $cart->add($purchasable, 12);
}

When I hit once it's working
when I hit again...
Getting error
Attempt to read property "id" on null
I found that session gets destroyed after calling $cart->add.

You have not provided any steps to reproduce, so I'm closing. If you require support, please see Discord or the Discussions section.

I have provided steps to reproduce...
Please check!

Can you please provide the stack trace?

OK, I've looked at this and your code is slightly wrong.
You need to use CartSession::add($purchasable, $quantity);. That will create a cart if one doesn't exist.
$cart = CartSession::current(); will only return a cart object if one has been created, or the config lunar.cart.auto_create is set to true.

I missed the mention that, I've already set auto_create to true.
In config/cart.php
Also cached config:cache

Also, check you have set-up the correct tax zones, otherwise it might complain also.
And be careful with auto-create, as it can end up creating a new cart for all visitors, regardless of whether they add something or not.

Also, check you have set-up the correct tax zones, otherwise it might complain also.
And be careful with auto-create, as it can end up creating a new cart for all visitors, regardless of whether they add something or not.

I'm calling the route /cart by ajax post, So it doesn't matter.

Also, check you have set-up the correct tax zones, otherwise it might complain also.
And be careful with auto-create, as it can end up creating a new cart for all visitors, regardless of whether they add something or not.

By setting up the correct tax zones fixed issue 😊
Thanks 😊


Improve typing

This bumps the # typed sigil to strict and runs srb tc in test cases.
This means some adjustments to the generated code (or quite a lot).
I would like to get initial agreement on the direction and then would do some clean up (there are definitely some simplifications possible and required).
Some things/questions/observations that come to mind:

The discrimator field for oneof values can be nilable (in generated code), even for required fields
Enums in one of fields are currently broken, the actual implementation. This was surfaced by sorbet, will fix this as a follow up PR
Optional fields take nilable values but then set the default value (which does not get encoded), this was also surfaced by sorbet

"required" and "optional" refer to the encoding. If a field is "required", it means that it will always be encoded. If it's "optional", then it's only encoded if it is not the default value. (This is confusing from a user's perspective, but unfortunately that's how the spec is defined)
I think only fields that contain submessages are actually nillable. Everything else should require some kind of value.

Interesting.
So should the constructor not accept nil values but rather have a default value then?
And setters (for optional fields) would then also just accept the non nilable type?
Doing that would simplify some things indeed


Add column for path when doing search

What feature or improvement do you think would benefit Files?
When doing search there's no easy way to see where all the files are that you just searched for. Should have another column for "path" which auto-shows after doing search

Requirements

Need to add a column type of "path"
Need to automatically switch column view to include it after searching

Files Version
<IP_ADDRESS>
Windows Version
Win 10 21H2
Comments
No response

Merging with #7070

Sorry, my search-fu didn't find that original issue...I did try! ;)


iOS 16 - stopRecordVideo() returns nothing

Describe the bug
On iOS, when you call stopRecordVideo(), nothing is returned.
Expected behavior
Should return a file path or base64 video
Smartphone (please complete the following information):

Device: iPhone 12
OS: 16.5.1

Additional context
To Native ->  CameraPreview stopRecordVideo 105993178
The native function gets called but no response

The same problem. Verified also on Android and there problem not occurs.

From the source code that I checked, there was some video capturing logic implemented on ios, but it was commented out, so I think it just isn't supported right now.
`func captureVideo(completion: @escaping (URL?, Error?) -> Void) {
guard let captureSession = self.captureSession, captureSession.isRunning else {
completion(nil, CameraControllerError.captureSessionIsMissing)
return
}
let path = FileManager.default.urls(for: .cachesDirectory, in: .userDomainMask)[0]
let identifier = UUID()
let randomIdentifier = identifier.uuidString.replacingOccurrences(of: "-", with: "")
let finalIdentifier = String(randomIdentifier.prefix(8))
let fileName="cpcp_video_"+finalIdentifier+".mp4"
    let fileUrl = path.appendingPathComponent(fileName)
    try? FileManager.default.removeItem(at: fileUrl)
    /*videoOutput!.startRecording(to: fileUrl, recordingDelegate: self)
     self.videoRecordCompletionBlock = completion*/
}`

Wow, we must all be on the same page today. Correct, the video recording stuff is commented out.

commit 92a56a229fe7aea9d9b549688b6e3a69675b7b50
Author: Anthony F
Date:   Sun Jun 6 11:07:38 2021 +0200

diff --git a/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java b/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java
index 1b0b2af..1f057ba 100644
--- a/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java
+++ b/android/src/main/java/com/ahm/capacitor/camera/preview/CameraPreview.java
@@ -1,6 +1,7 @@
 package com.ahm.capacitor.camera.preview;

...skipping...
         jsObject.put("videoFilePath", file);
-        pluginCall.success(jsObject);
+        pluginCall.resolve(jsObject);
     }
     @Override
     public void onStopRecordVideoError(String error) {
@@ -404,7 +390,7 @@ public class CameraPreview extends Plugin implements CameraActivity.CameraPrevie
     @PluginMethod()
     public void startRecordVideo(final PluginCall call) {
         if(this.hasCamera(call) == false){
-            call.error("Camera is not running");
+            call.reject("Camera is not running");
             return;
         }
         final String filename = "videoTmp";
@@ -425,17 +411,19 @@ public class CameraPreview extends Plugin implements CameraActivity.CameraPrevie
             }
         });

-        call.success();
+        call.resolve();
     }

     @PluginMethod()
     public void stopRecordVideo(PluginCall call) {
        if(this.hasCamera(call) == false){
-            call.error("Camera is not running");
+            call.reject("Camera is not running");
...skipping...
-        videoOutput!.startRecording(to: fileUrl, recordingDelegate: self)
-        self.videoRecordCompletionBlock = completion
+        /*videoOutput!.startRecording(to: fileUrl, recordingDelegate: self)
+        self.videoRecordCompletionBlock = completion*/
     }

     func stopRecording(completion: @escaping (Error?) -> Void) {
@@ -412,7 +412,7 @@ extension CameraController {
             completion(CameraControllerError.captureSessionIsMissing)
             return
         }
-        self.videoOutput?.stopRecording()
+        //self.videoOutput?.stopRecording()
     }
 }

How do I get this running locally? I'd like to test things out

Any updates?

I have tried fixing the issue here: https://github.com/mario-deaconescu/camera-preview/tree/ios-video-recording
stopRecordVideo() now returns a path to the recorded video. I have not yet tested if the video actually displays correctly, because I am using Capacitor with Angular right now, and I don't know how to display a local file in a  tag. Perhaps by using the Capacitor filesystem plugin, but I haven't gone into it at the moment. Feel free to look over the code, test it, and propose changes. If all goes well I will issue a pr to solve the issue.

@mario-deaconescu I reviewed your changes and pulled in your "ios-video-recording" branch. I still don't see any return data / path. Looks like stopRecording may be promise, but I'm not getting data back from a ".then" either. Are you actually seeing an *.mp4 path returning?

@ttgsgmafe Yes, I am receiving a .mp4 path in Library/Cache. Are you receiving any errors? I tried setting it up such that anything that results in no video throws an error. And if you're actually not receiving anything, does the iOS plugin return a path that's not received by the typescript promise, or is it not even returning anything from the native code?

Can confirm it works @mario-deaconescu! 🎉
End the recording:
  const result = await CameraPreview.stopRecordVideo();
  const fileName = result.value.substring(result.value.lastIndexOf("/") + 1);
  const file = await Filesystem.readFile({
    directory: Directory.Cache,
    path: fileName,
  });

Show the footage:
{file.data && (
  <video
    autoPlay
    loop
    src={`data:video/mp4;base64,${file.data}`}
    style={{
      width: "100%",
      height: "100%",
      position: "absolute",
      top: 0,
      opacity: videoBase64 ? 1 : 0,
    }}
  />
)}

Thank you!

@mario-deaconescu  @alexandargyurov  Thanks for the super quick responses! I figured out my problem. I had manually replaced the "@capacitor-community/camera-preview" with the Git URL, removed the node_modules, and reinstalled. However, it was still pulling the original camera-preview from my package-lock.json.
I'm returning the path now.
This is awesome! Thanks again!

i'm having the same issue. I dont get what you guys did to make it work. We are using ionic/angular/capacitor. The function stopRecordVideo() is returning nothing, and also we cant get errors within try catch. Can anyone help ?


Update chnagelog and version number

What? and Why?

What does this pull request change/fix? Why was it necessary?

Checklist

[x] CHANGELOG.md updated? (if required)

Codecov Report

Merging #110 into master will not change coverage.
The diff coverage is 100%.

@@           Coverage Diff           @@
##           master     #110   +/-   ##
=======================================
  Coverage   87.48%   87.48%
=======================================
  Files          17       17
  Lines        1390     1390
=======================================
  Hits         1216     1216
  Misses        174      174

Impacted Files
Coverage Δ

transform/__init__.py
100% <100%> (ø)
:arrow_up:

Continue to review full report at Codecov.

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


[SE-0395] Rename _Observation module to Observation

The review of SE-0395 is down to small details at this point that won't affect the overall shape of the API much. Rename the model in anticipation of that.

@swift-ci please smoke test

@swift-ci please smoke test


Merge extension and mobile controllers

We want to use one shared set of controllers on both MetaMask extension and MetaMask mobile. This is to reduce to maintenance burden of each team, so that it is easier for us to provide a stable and secure codebase.
This issue description is still a work in progress. This will be updated with a list of each set of controllers to merge.
Each pair of controllers is listed in this checklist, each with sub-tasks that roughly map out the work required to merge the two controllers.
Tasks
Extract any API interactions or complex utility functions
Much of the complexity in our controllers is tied to functionality that is better managed as a separate module. Extracting API interactions and complex functionality can simplify the migration process and reduce maintenance.
Refactor to be more easily understood
Some of our controllers are built in a way that makes them very difficult to reason about. For example, they might expose too many internal methods/properties, or they might have race conditions and complex polling logic. We need to understand how these controllers work in order to merge them, so we may have to spend some time simplifying them before merging in some cases.
Write comprehensive unit tests
By writing comprehensive unit tests for the controllers before we merge them, we can reduce the chance of introducing a regression.
Normalize the functionality across both controllers
The more similar we make the two controllers prior to merging them, the easier the final step will be.
Migrate
Migrate the extension and mobile projects to use the new shared controller. This is the last step.
Checklist

[ ] Approval

[x] Extract any API interactions or complex utility functions
[x] Refactor to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] AssetsContract

[ ] Convert to library

[ ] Collectibles

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] CurrencyRate

[x] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] TokenList

[x] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] TokenRates

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] Tokens

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] GasFee

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] Phishing

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] AddressBook

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] All message managers

[x] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[x] Migrate

[x] #753

[x] Extract any API interactions or complex utility functions
[x] Refactored to be more easily understood.
[x] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] Transaction / IncomingTransactions

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] Swaps

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] AccountTracker / CachedBalances

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] NftDetection

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] TokenBalances

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] TokenDetection / DetectTokens

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] Keyring (wrapper) / keyring related metamask-controller methods / Identity related state (#431)

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[x] Permission

[x] Extract any API interactions or complex utility functions
[x] Refactored to be more easily understood.
[x] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] Announcement

[x] Extract any API interactions or complex utility functions
[x] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[ ] Migrate

[x] SubjectMetadata

[x] Extract any API interactions or complex utility functions
[x] Refactored to be more easily understood.
[x] Write comprehensive unit tests
[x] Normalize the functionality across both controllers
[x] Migrate

[ ] Ens (cache) / Ens (resolve)

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] Preferences

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] Alert

[x] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] AppState

[x] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] MetaMetrics

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] Onboarding

[x] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] PermissionLog

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] SmartTransactions

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] Snap

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

[ ] Notification

[ ] Extract any API interactions or complex utility functions
[ ] Refactored to be more easily understood.
[ ] Write comprehensive unit tests
[ ] Normalize the functionality across both controllers
[ ] Migrate

Notes from Monday's standup:
We probably need to prioritize Network and Keyring over other controllers.

We're starting to ramp up work on multi-network support
We've been wanting to fix the keyring stuff for a long time

I have just finished making a first pass on this, checking off anything that is clearly completed already. 40 tasks are completed out of 188, that's our starting point.

Nice!!

Here are a few jotnotes regarding the current status of remaining migrations:
Potentially straightforward (4):

AccountTracker / Cached Balances
TokenBalances
TokenDetection
PermissionLog

Collaboration (6):

AppState

Tricky

Preferences

Tricky

Announcement

Check with mobile team first

ENS

Integration is leftover

Swaps

Swaps team

SmartTransactions

Involve swaps team

Not applicable at the moment (5):

Alert

Not relevant to mobile

Snap

Snaps

Notification

Snaps

Onboarding

Mobile feature that they don't currently support

MetaMetrics

Major effort already planned to be done by mobile team

I've created https://github.com/MetaMask/core/issues/1509 which is related to this effort.

I'm not sure if this will help and I understand everything you saying which is crazy but I don't think I can actually really speak in your terms so I try to do the best I can by telling you what happened I've always been interested in the nft and crypto when they came out with the artwork that you can turn your artwork into an nft my female friend in the whole time she was hacking my MacBook pro since February of last year so she's been in the database logs for a while before I've even started the digital thing so digital currency so she's been stalking me the whole time so everything that I do she's seeing it she's she's been inside of it and then go actually goes the opposite direction and so she had the Creator duality person splitting the body in half so that's what like I'm kind of getting that that you're saying she's if you need my IP address and and of my MacBook pro I still have my iPad I still have a stop using the MacBook pro because she was terminally uploading every single file from day one I bought the MacBook pro she was trying to upload all those files also she had remote access to my computers and stuff like that so she's been hacking my  for a long time...
If there is anything that you need from me. data logs anything like that as far as you  identifying her from me
...
In another thing not to put my business out there on this site and I'm willing to risk whatever it takes I created this account to change help change my life and my kids life for positive ...
Future .
Right now by my ex doing all of this
She has committed fraud on a lot of my accounts using null web3
I could possible be in prisoned by her doing this ...
I know you n your team has helped so much..and you just started..
But understand my freedom and life is on the line on this ...
What ever info account info.
Personal info that will help fully recover and secure my account , family , freedom and life ...
.....


jams.Annotation.trim() doesn't include events with 0 duration that's on the trim boundary

This issue is about jams.Annotation.trim()
Reproduciable code is below:
import jams
print(jams.__version__)

ann = jams.Annotation(namespace='beat', duration=4)
ann.append(time=0, duration=0, value=1)
ann.append(time=1, duration=0, value=2)
ann.append(time=2, duration=0, value=3)

print('----------')
for obs in ann.trim(0, 2.1, strict=False):
    print(obs)

print('----------')
for obs in ann.trim(0, 2, strict=False):
    print(obs)

print('----------')
for obs in ann.trim(-1, 1.9, strict=False):
    print(obs)

Current Output:
0.3.4
----------
Observation(time=1.0, duration=0.0, value=2, confidence=None)
Observation(time=2.0, duration=0.0, value=3, confidence=None)
----------
Observation(time=1.0, duration=0.0, value=2, confidence=None)
----------
Observation(time=1.0, duration=0.0, value=2, confidence=None)

Desired Output:
0.3.4
----------
Observation(time=0.0, duration=0.0, value=1, confidence=None)
Observation(time=1.0, duration=0.0, value=2, confidence=None)
Observation(time=2.0, duration=0.0, value=3, confidence=None)
----------
Observation(time=0.0, duration=0.0, value=1, confidence=None)
Observation(time=1.0, duration=0.0, value=2, confidence=None)
Observation(time=2.0, duration=0.0, value=3, confidence=None)
----------
Observation(time=0.0, duration=0.0, value=1, confidence=None)
Observation(time=1.0, duration=0.0, value=2, confidence=None)

I took a look at the source code, and I think it's down to maybe adding some equal signs in this line: https://github.com/marl/jams/blob/6bc2d2e25f17860235dcd5c75fd348d3826f30b9/jams/core.py#L919
But I'm not sure if it will break other things.
Is this intended behavior? Right now it's impossible to slice or trim out the first beat of this annotation.

Oy this is a delicate one.  It ultimately comes down to the semantics around time intervals.  I've long advocated for a half-open interpretation [t, t+d), but I don't recall if we ever made that explicit.  (Or maybe @justinsalamon had arguments for closed intervals. :man_shrugging: )
I think you've highlighted the right part of the code for fixing this, but I'm not 100% clear on what the correct logic should be here.  Maybe making both sides of the comparison include the boundary conditions?

I would lean slightly toward a [t, t+d) interpretation.
In any case, I think annotations that happen exactly at start_time of the trim should be definitely be included.
The current behavior is surprising to me (and potentially other users), in that my first beat of the dummy_annotation is always missing no matter how I slice it.

I would lean slightly toward a [t, t+d) interpretation.

If we take that interpretation, then the semantics of trim should be that any observation starting at or after end_time would be discarded.  I think this is reasonable, as any such observation would have duration 0 after trimming anyway.
The only wrinkle that I can see (and I think this is where @justinsalamon was coming from previously) is in the interpretation of densely sampled annotations, eg, f0 contours.  These annotations typically have duration 0 for each observation already, so trimming to duration 0 doesn't necessarily introduce any new errors here.
To reheat an old argument, the problem with duration-0 observations is that they're inconsistent with the half-open interval property: [t, t+0) is the empty set, and by definition doesn't actually cover any time instant.  Closed intervals [t, t+0] would cover exactly time t, but then it becomes ambiguous how to interpret an annotation like [t, t+d], [t+d, t+2d] because time t+d belongs to both intervals.  This isn't always wrong, since intervals can overlap in general, but it provides no way to encode disjoint partitions of time.  The argument for 0-duration being special is that it should correspond to uniformly sampled signals (like f0 contours) where we don't want to imply piecewise constancy between samples.  This is basically the compromise that we struck when standardizing the observation schema.
One way that we could reconcile this is to say that non-0 intervals are always interpreted as half-open, and that includes annotation start/duration.  So when we trim an annotation, it's slicing down to a given interval [start, end), which implies discarding observations from the ranges [end, +inf) or [-inf, start).

Going back to @tomxi 's original example:

ann = jams.Annotation(namespace='beat', duration=4)
ann.append(time=0, duration=0, value=1)
ann.append(time=1, duration=0, value=2)
ann.append(time=2, duration=0, value=3)
print('----------')
for obs in ann.trim(0, 2.1, strict=False):
print(obs)

All observations have start time 0 <= time < 2.1, so should be included.  The fact that the first one fails is a mistake.

print('----------')
for obs in ann.trim(0, 2, strict=False):
print(obs)

Only the first two observations are in the trim interval, the last one starts at time 2 >= trim_end and should not be included.

print('----------')
for obs in ann.trim(-1, 1.9, strict=False):
print(obs)

Again, this should only include the first two observations.


Naming Consistency in the AddOn List

This is not an issue, but more something that has to do with Naming Consistency and hope is a simple and fast fix.
These look good

These are missing the -

ty for reporting, resolved with 2022.11.18

All of them look good but Herbs 😁

Sorry about that.. I had duplicate title statements.. fixed in 2<IP_ADDRESS>


[FEATURE] Support KWIVER pipelines for performing video re-encoding and image enhancement on upload

Some people might want to enhance their videos/images when being uploaded into the system, so we probably want a check-mark for this. Example KWIVER pipeline: filter_enhance.pipe

@mattdawkins can you describe the kwiver options/command necessary for running this in a pipeline?
This issue needs detailed requirements.

Client side enhancement options?
pipeline enhancement options?

There's a couple pipes which could apply here beginning with the filter_* prefix (so maybe another wildcard option would make sense)
filter_extract_frames.pipe  - Just extracts frames using KWIVER downsampler no enhancement
filter_enhance.pipe - Runs image enhancement and outputs image list
filter_extract_left.pipe - Crops out left half of image in case stereo composites
filter_debayer_and_enhancepipe - Runs debayering on input camera raws and enhancement
Inputs are the same as every other pipe covered so far, outputs are as follows for 6 0 padded #s:
-s output:file_name_template=great_folder/frame%06d.png
There's a few which can be set via parameters which are fixed for the job, though probably lesser priority
:filter:ocv_enhancer:apply_smoothing         false
:filter:ocv_enhancer:smooth_kernel           3
:filter:ocv_enhancer:apply_denoising         false
:filter:ocv_enhancer:denoise_kernel          3
:filter:ocv_enhancer:denoise_coeff           2
:filter:ocv_enhancer:auto_balance            true
:filter:ocv_enhancer:force_8bit              false
:filter:ocv_enhancer:apply_clahe             true
:filter:ocv_enhancer:clip_limit              3
:filter:ocv_enhancer:saturation              1.20
Out of these saturation, float [ 0, 10.0 ] might be most useful and clip limit (int, [ 0, 10 ])

@subdavis do you have the information you need for this?


chore(deps): upgrade dev dependencies

Upgrades project dependencies. See details in workflow run.

Automatically created by projen via the "upgrade-dev-dependencies-k8s-26-main" workflow

⚪ Backport skipped
The pull request was not backported as there were no branches to backport to. If this is a mistake, please apply the desired version labels or run the backport tool manually.
Manual backport
To create the backport manually run:
backport --pr 3560

Questions ?
Please refer to the Backport tool documentation


Annotate compiler functions

The goal of this (sequence of) PR(s) is to uniformize the different kinds of compilation subroutines appearing in CL-QUIL, to annotate them with information about e.g. which architecture they target, and to replace the hard-coded material in chip-specification.lisp with a mechanism that extracts a subset of compilers that target a given architecture. The hope is that this will also feed into our plans for "fine-grained compilation": this will both make it easier for users to define custom compilers and to control the list of compiler techniques that CL-QUIL uses as it proceeds.
What follows are some musings about the road between here and there. Keeping in mind our main goal of automating the decision of what compiler to use when, shat are the salient features of a compiler?

A compiler consumes a string of instructions (and perhaps some context), then emits a string of instructions.
A compiler matches on a particular form of input: instruction name, qubit count, ..., all the way up to arbitrary predicates based on the matrix form of an instruction.
A compiler provides guarantees about the emitted sequence, e.g., what gate set it belongs to, or the ordering of instructions, or the number of instructions (either total or of a particular type).

What "breeds" of compilers do we currently have?

"Translators": one in, many out; match on operator name and perhaps a #'double= condition on the parameter value.
Chip-sensitive "translators": one in, many out; uses context like chip topology to decide what constitutes legal output.
"Rewriting rules": many in, many out; matches on operator name and perhaps on complicated conditions on parameter values; usually stays within a prescribed gate set for both in and out.
Context-sensitive "rewriting rules": all of the above, except there are also complicated conditions involving the context, e.g., whether the present wavefunction of the quantum computer is an eigenstate for the instruction.
Generic compilers: one in, many out; some don't match on anything except qubit count (optimal-2q, qs-compile); some match on name (ucr-compile); some match on matrix structure (ucr-recognize).
"Approximation templates": one in (actually, a canonical coordinate (which maybe we could replace with a pseudoinstruction?)), many out; uses chip information to make a decision about when we might return not-quite-the-right gate.

What are some useful tools can you might use to make guarantees about successful termination? Here it seems like there are only a few major features of instructions, in what I'd consider to be their decreasing order of severity: their qubit count, their operator name, and their parameter values. Target gate sets typically impose strong conditions on each of these (e.g.: ≤2Q gates; of the 2Q gates only CZs; of the 1Q gates either RX or RZ; of the RX gates only RX(k pi/2)). CL-QUIL resolves these constraints in the order given:

The addresser applies size-reduction compilers and uses an understanding of the chip topology to interleave SWAPs until topological constraints are satisfied.
The addresser also applies compilers that specifically target the native gate set, which is conceptually distinct (but perhaps useful for optimization purposes).
The compressor uses commutation laws to collect instructions into buckets that act on not-too-many qubits, then applies compilers that reduce overall instruction count.

One might imagine, then, a dependency graph of compilers which (1) has its completeness verified by producing paths from "arbitrary" instructions to some desirable set of sinks (the target gate set) and (2) gets pruned according to these paths to produce an efficient subset of "applicable" compilers. This PR provides a variant of exactly this functionality; the primary restriction is that it handles only hardware objects with a finite and fixed number of qubits participating (i.e., the mechanisms for assembling "global" or "generic" compilers remain unaltered).
Here are a bunch of outstanding tasks, either for this PR or for follow-ons:

[ ] Fix all the undefined function warnings on load.
[x] Expose gateset definitions as an ISA layer, read in before the hardware object layers are.
[x] Investigate sources of slowdown, especially in the test suite. RESULTS: The test suite on this branch takes about 1.5x as much time as master and conses about 1.6x as much as master. There's room for improvement here, but I think this is within tolerance for merging.
[x] nondestructively-apply-instr-to-wf is an awfully verbose name, especially now that it's appearing in :where clauses. Maybe wf-after-instr or so?
[x] Rename operator-bind.lisp to something that better reflects its new contents.
[ ] Consider making the generic compiler list more programmable. At present, it's obnoxious even to update its contents: C-c C-c'ing its definition doesn't actually seem to replace the present value, nevermind intelligent selection of routines on the fly. No bueno.
[x] Update doc/ to reflect these changes.
[x] Benchmark the new compilation output with that of master, to make sure that no great less of efficiency has slipped in. RESULTS: The test suite on this branch emits ±10% the gate length of master. Again, there's room for improvement here, probably centering on the ability of the rewriting rule crawler to correctly pull in applicable rules.
[x] Investigate intermittent Euler test failure.
[ ] Add *compiler-noise-stream* output to the compiler assemblers
[ ] AFTER MERGE: Open pyQuil issue to send "new" ISA definitions over the wire. (Then attach a follow-on issue to that: deprecate the old chip-reader paths in CL-QUIL.)

There is work still to go on the PR, as indicated in the TODOs, and some of this missing work will make this difficult to read for now—but it's a very large PR and will take substantial time to review no matter what, and much of what I'd like feedback on is code organization / style, as I'm not a very experienced metaprogrammer. So, I'd like to start the conversation earlier.
There's a good amount of metaprogramming; CC @stylewarning and @rigettizach .

Do you think you could write some eric-style verbiage in our latex docs about your overall design considerations?

Yeah, I can write some long-form docs. I'll do that this afternoon.

Consider making the generic compiler list more programmable. At present, it's obnoxious even to update its contents: C-c C-c'ing its definition doesn't actually seem to replace the present value, nevermind intelligent selection of routines on the fly. No bueno.

@ecpeterson Does this item in your todo-list refer to the (defvar *global-compilers* ...) in chip-specification.lisp?

@appleby That's right. It's still mostly-hardcoded, and the only piece of software that touches it automatically is cl-quil/tweedledum, which pokes one extra entry into it. All other such lists are now runtime-generated; this is the lone survivor.

@appleby That's right. It's still mostly-hardcoded, and the only piece of software that touches it automatically is cl-quil/tweedledum, which pokes one extra entry into it. All other such lists are now runtime-generated; this is the lone survivor.

This doesn't really address the auto-generated portion, but regarding C-c C-c not working, C-M-x may provide some relief. From the SLIME docs:

C-M-x
M-x slime-eval-defun
Evaluate the current toplevel form and show the result in the echo area. ‘C-M-x’ treats ‘defvar’ expressions specially. Normally, evaluating a ‘defvar’ expression does nothing if the variable it defines already has a value. But ‘C-M-x’ unconditionally resets the variable to the initial value specified in the ‘defvar’ expression. This special feature is convenient for debugging Lisp programs.

Alternatively, switching to defparameter would get C-c C-c working, I think, but would clobber tweedledum modifications on any re-load/compile of chip-specification.lisp.

One slight smell of the compilers is the way that the instructions are built up. Right now, the expectation is that a compiler builds a list and returns it. This good, especially for "simple" compilers that are mere templates, but is quite annoying if we write more complicated compilers. Some of the compilers (UCR ones?) show this complexity with some good old fashioned nconcing and the like.
One idea is to—in these macros—expose a local function called inst which allows emitting instructions piecemeal. This is inspired by SBCL's VOPs, which is how they generate assembly code. The idea is that none of the list handling or consing is done by the user (in these macros), and instead done by this macro and surrounding logic. I think this removes a small footgun of accidentally shared list memory.
I would propose something like these definitions:
(defun inst (&rest xs)
  "Emit the instructions XS in the current compiler context.

INST is a local function usable within the dynamic extent of a compiler body."
  (declare (ignore xs))
  (error "INST can only be used in the body of a compiler."))

(define-compiler-macro inst (&rest xs)
  (declare (ignore xs))
  (error "INST can only be used in the body of a compiler."))

(defmacro finish-compiler ()
  "Finish compiling, retuning all instructed emitted with INST.

FINISH-COMPILER is a local macro usable within a compiler body."
  (error "FINISH-COMPILER can only be used in the body of a compiler."))

(defmacro with-inst (&body body)
  (let ((list (gensym "LIST"))
        (tail (gensym "TAIL"))
        (compiler-context (gensym "COMPILER-CONTEXT"))
        (x  (gensym "X"))
        (xs (gensym "XS")))
    `(block ,compiler-context
       (let* ((,list (cons nil nil))
              (,tail ,list))
         (declare (dynamic-extent ,list)
                  (type cons ,list ,tail))
         (flet ((inst (&rest ,xs)
                  (declare (dynamic-extent ,xs)
                           (optimize speed (safety 0) (debug 0) (space 0)))
                  (dolist (,x ,xs)
                    (rplacd ,tail (cons ,x nil))
                    (setf ,tail (cdr ,tail)))
                  (values)))
           (declare (dynamic-extent #'inst))
           (macrolet ((finish-compiler ()
                        '(return-from ,compiler-context (cdr (the cons ,list)))))
             ,@body
             ;; Implicitly return the collected instructions.
             (finish-compiler)))))))

This introduces INST and FINISH-COMPILER as a local function and macro respectively. Here's a few examples of use:
; Evaluation aborted on #<SB-INT:COMPILED-PROGRAM-ERROR {100BC9B633}>.
CL-USER> (with-inst
           (inst 1 2 3)
           (inst 4 5 6))
(1 2 3 4 5 6)
CL-USER> (with-inst
           (inst 1 2 3)
           (finish-compiler)
           (inst 4 5 6))
(1 2 3)
CL-USER> (with-inst
           (dotimes (i 6)
             (inst i)))
(0 1 2 3 4 5)

If these local things are used outside of the context of WITH-INST, then they will error at compile time. The local function INST might optionally include typechecking.
The non-local control of give-ups also works with this stuff fine.

@stylewarning I like this inst suggestion a lot, but I need to let it gel a while longer. Here's an issue for tracking: #335 .

I think this is ready for final review / merge. I'd like #289 to go in first, if possible.

My shallow gripe is that the docstring to define-compiler doesn't immediately follow the compiler name.

Yeah but that's also not the case for functions: (defun name lambda-list decls? docstring? &body body) doesn't have docstring right after name either.

I take it back. I'm not sure what I was thinking.


Internet search result gathering

As a user, I would like to search for stuff on the web directly from Algernon. Therefore I want my search to be executed with a search engine.

We decided to use the Google Custom Search JSON API for searching the WWW. It offers 10.000 Queries a day and you don't have to supply any billing information. We should further discuss, if every user has to create his own custom search engine to receive an API key or if this could be optional and there would be a default Algernon custom search engine for all Algernon users at the same time.


mod2obs with different depvar names

patch in mod2obs and a test for it.  Also moved to np.asarray() and dropped explicit copy=False according to numpy 2 suggestions (also pinned explicit numpy>2).  @mwtoews lemme if you think this is an ok approach (instead of np.array() like it is now) and also your thoughts on explicit numpy > 2 (I need this for some pyemu-ppu integration stuff).

Apologies for the delay @jtwhite79 currently on annual leave but I could probably find some more time to give this a better review.
Ideally this package should work with most versions of NumPy, without need to pin to any particular version.

@mwtoews you ok to merge this in?  The reason I wanted to pin to np2 is just to make sure the tests are using np2 (for now) since that seems to be where the problems are...

I'm probably OK with most of this, but a bit confused by the commit history. The .lst files don't need to be added (and should be added to gitignore). I've removed the explicit copy=False with 9758c86d9f6d52959b4f482cee2c5149e5547aea, so these changes aren't seen here. I can't recall why I chose np.array but it seems that np.asarray is the better choice. I still don't think any pinning is necessary, as we are testing both 2.x and 1.x already. Pinning just leads to complications when integrating multiple packages.

@jtwhite79 I'll make a few adjustments to this PR then I'll merge it. I can look into making a release, perhaps later today if I can find the time.

@jtwhite79 I've made a few edits, and I'll let you hit the merge button if you are happy with them. I've remove explicit numpy version pinning since it is unnecessary, since this code is designed and tested for numpy 1.x and 2.x.
I'll hopefully get to a PR tomorrow to clean-up a few other aspects before setting a release.


DCOS_OSS-3582: enable prettier for typescript files

**  How to review **

Write a typescript file which is not pretty (everything in one line for example)
Run npm run lint
See an error

Checklist

[X] Did you add a JIRA issue in a commit message or as part of the branch name?
[ ] Did you add new unit tests?
[ ] Did you add new integration tests?
[ ] If this is a regression, did you write a test to catch this in the future?

Fixed the typos in the description.


Add values to dimen.xml

Fixes #70
Changes:
Add hardcoded values to dimen.xml file being a good practice to follow.

Fix conflicts

Please read about how to write strings in programming. You have mixed camel case and snake case. Define string in snake case only for resources(xml) and use camel case while writing the java/kotlin code.

@cweitat @iamareebjamal please review this PR

@adityastic Please review it

Resolve conflicts


feat: update uuid to 0.5

Updates uuid to 0.5 matching many other libraries (serde, postgres)

@bfrog Thanks


ipv6 Support

Intra completely disables ipv6 even if the dns servers have DOH capable ipv6 support and the device also has working ipv6 connectivity

Yes, see #64 and #155.  Essentially, the problem is that the underlying LWIP library declares every socket successfully connected, even if IPv6 connectivity is not working, and this breaks the IPv6 detection logic in some apps.

So the solution to this problem would be?

The only solution I'm aware of would be to replace LWIP with a more flexible asynchronous TCP implementation, such as gVisor's tcpip package.  That would allow us to delay answering a SYN until after receiving a response from the server.
This would be a major change in Intra's architecture, so I don't expect it will happen any time soon.


Add missing dot after copyright.

The following stuff each has a dot at the end.

This is intentional so developers have full control of the text.

It's still a breaking change from the basic theme:
https://github.com/sphinx-doc/sphinx/blob/80d9728101ab349050a708261da623a306f09f85/sphinx/themes/basic/layout.html#L199-L205

Looks this is superseded by https://github.com/readthedocs/sphinx_rtd_theme/pull/933, discussion about the final dot https://github.com/readthedocs/sphinx_rtd_theme/pull/666

Closed by https://github.com/readthedocs/sphinx_rtd_theme/pull/933


add tcp flag filtering

Add a new option for filtering using TCP Flags. semantics is similar to iptables. You provide a set of flags and a mask to test the flags with.
I havn't seen existing tests for filtering logic, so would appreciate some insight on how to best tests this. I've ran it manually and it seems to work.

@brb thank you for the review; I'm a bit under the weather this week, so will be able to make code changes/tests next week

@brb I updated the GH workflow to include the new flag. Can you please approve the workflow so that CI runs?

Hey, thanks for the update. I'm a bit short on time this week, will try to re-review by EOW.


Add Bicep to list of CloudFormation comparisons

@MarcusFelling : Thanks for your contribution! The author(s) have been notified to review your proposed change.

#Sign-Off


Wipe out our /etc/hosts changes before reboot

This ensures the systemd/wicked logic is unaffected by our /etc/hosts
changes.

I think it's safer to explicitly run etc-hosts right after the salt-minion has come back if we do this before rebooting, so we don't wait for the highstate to set up /etc/hosts again (ordering would be a mess).

At that point, it's too late. We no longer have the right data to re-render etc-hosts, and systemd/wicked has already changed the hostname to match what was in /etc/hosts between "power on" and salt-minion finally starting.

At that point, it's too late. We no longer have the right data to re-render etc-hosts, and systemd/wicked has already changed the hostname to match what was in /etc/hosts between "power on" and salt-minion finally starting.

Yes, what I mean is that in addition to the current change we can also run the etc-hosts forcefully right after the minion is back, so we are sure that when we run a highstate the /etc/hosts is well formed.

Yes, what I mean is that in addition to the current change we can also run the etc-hosts sls forcefully right after the minion is back, so we are sure that when we run a highstate the /etc/hosts is well formed.

Ahh - makes sense. Will update tomorrow.


does not work!

What's Wrong?

But it works!
With such issues I can not start ...

Sorry the text was not published..

The adapter is written for the current stable state of the admin adapter, your screenshot shows the outdated admin interface.
So the settings for the adapter is only available in the current admin interface.


Deprecated Spotify APIs Causing Errors: AudioAnalysis, AudioFeature and Recommendations Methods in spotify: ^0.13.7

Description:
The AudioAnalysis and AudioFeature API calls in Spotify have been deprecated, resulting in errors when attempting to use these methods in the Flutter Spotify package at lib/src/endpoints/audio_analysis.dart, lib/src/endpoints/audio_features.dart and lib/src/endpoints/recommendations.dart.
Steps to get the error:
Use the AudioAnalysis or AudioFeature method provided by the package.
Run the application and observe the error in the response.
Expected Behavior:
The methods should either function correctly (if alternative endpoints are available) or be removed/deprecated from the package to avoid confusion.
Actual Behavior:
API calls result in errors, likely due to Spotify deprecating these endpoints.
Possible Solution:
Update the package to use Spotify’s recommended alternative APIs (if available).
Clearly mark the methods as deprecated in the documentation and provide guidance on alternatives.
If no alternatives exist, consider removing these methods to prevent usage errors.
Additional Context:
Spotify's API deprecation notice:
https://developer.spotify.com/documentation/web-api/reference/get-audio-features
https://developer.spotify.com/documentation/web-api/reference/get-audio-analysis
https://developer.spotify.com/documentation/web-api/reference/get-recommendations
Version of the Spotify Flutter package being used: [0.13.7].
This issue affects users relying on these methods.

@Prakash251299 thank you for pointing this out.
There is a whole bunch of API's that are now deprecated.
Regarding that blog post, there are no alternatives, which is unfortunate.
@rinukkusu  I suggest not to remove the endpoints, but to mark them as depracated with a clear warning that spotify will shut down these endponts sometime in the future and that our users should use them at their own risk. What do you think?


Parser breaks whenever Java Keyword is used as a class name, field name, or method name

Parsing the code below in Recaf fails because a Java Keyword is being used as the class name:
public class while {
}

This also happens when you use a Java Keyword for field names, method names, and package names.
Please let me know if this needs to be reported to javaparser instead.

JavaParser does not play well on obfuscated code, consider using assembler instead.

As xxDark said, there's not much we can really do about it. JavaParser is not made by us, and handling keywords as identifiers is a tricky business. You can ask them about it but I doubt they offer much.
This is why Recaf has an assembler (which was around first anyways). Its been improved on the 3X branch, which is where all our support is currently going into.


Added Vsphere Session Idle timeout config option

On osirium-main CI sometimes we see failure due to "vSphere unauthenticated" exception.
After investigating, we found out that is due to idle timeout defaulting to 900 on  pyvmomi library.
This PR increases to 7200 as default and add an option to change it via INI file.

Codecov Report

Merging #22 (02740e7) into master (56c833b) will decrease coverage by 6.30%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##            master      #22      +/-   ##
===========================================
- Coverage   100.00%   93.69%   -6.31%
===========================================
  Files           11       11
  Lines         1395     1395
  Branches        97       97
===========================================
- Hits          1395     1307      -88
- Misses           0       87      +87
- Partials         0        1       +1

Impacted Files
Coverage Δ

vcdriver/config.py
95.65% <ø> (-4.35%)
:arrow_down:

vcdriver/session.py
100.00% <ø> (ø)

test/unit/test_config.py
41.49% <0.00%> (-58.51%)
:arrow_down:

Continue to review full report at Codecov.

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

Codecov Report

Merging #22 (02740e7) into master (56c833b) will decrease coverage by 6.30%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##            master      #22      +/-   ##
===========================================
- Coverage   100.00%   93.69%   -6.31%
===========================================
  Files           11       11
  Lines         1395     1395
  Branches        97       97
===========================================
- Hits          1395     1307      -88
- Misses           0       87      +87
- Partials         0        1       +1

Impacted Files
Coverage Δ

vcdriver/config.py
95.65% <ø> (-4.35%)
:arrow_down:

vcdriver/session.py
100.00% <ø> (ø)

test/unit/test_config.py
41.49% <0.00%> (-58.51%)
:arrow_down:

Continue to review full report at Codecov.

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


Figure out why Jill can't print the Student Profile page!

Browser: Chrome
OS: Window
When Jill does Ctrl + p on the front page of Insights, it brings up a print dialogue window for her... but when she presses the same keys on the Student Profile page, no printing dialogue shows up. Why is this?

Now she can because we have printable reports from @jhilde!


Exploration: Allow returning new requests from API routes

Description
Exploring here a simple way to concatenate requests in an API route. This works with raw HTML forms. We could also return an RSC response instead, but we'd need a custom Form component to interpret the result.
Instead of returning a new Request we could use a helper function or anything like that.
@blittle @jplhomer  do you think this concept could be interesting?

Before submitting the PR, please make sure you do the following:

[ ] Read the Contributing Guidelines
[ ] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123)
[ ] Update docs in this repository according to your change
[ ] Run yarn changeset add if this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning

This is awesome! Very similar to what we've discussed in #883

@frandiox I think this could be useful independent of the Form component.


chore: Update LangChain to 0.0.323 and aiplatform to 1.35.0

LangChain update includes Client Library usage metrics for tracking.

I agree on removing the pin if we can add good tests. I've struggled to find a reliable way to set them up for notebooks. Most of them focus on testing functions, which most of these notebooks don't really do, and we'd need to setup infrastructure/projects to make the API calls.


Return ZLP on empty requests of descriptors

Thank you for your Pull Request! I have assigned a reviewer to this issue and it may take them some time to get to reviewing this. In the meantime, would you be willing to work on addressing the conflicts with this PR?

@straithe sure: Rebased on lastest main.

Thank you very much! I do have a reviewer assigned to this PR. It might take them a bit of time to get to this, but please know that we have seen this PR and appreciate your work.

Checked your suggestion solution and really like it! Suggest to merge that instead.

Merged manually with those changes, thanks again!


New line before header causes content to silently be part of the body

Having a request like
POST https://example.com
Foo: bar

{"hello": "world"}

works, but
POST https://example.com

Foo: bar

{"hello": "world"}

will cause the header to be part of the body, even though the syntax highlighting makes it look like the headers will be handled as headers

Hmm, so I'm parsing it in such a way that all headers have to be the subsequent line so I can properly demarcate where the body starts. Do you think that's unnecessary or do you think there's a better way to set my grammars for syntax highlighting to look out for line breaks?


Issue with server listening on IPv6

Here is the issue i can run on specific IPv4 & IPv6 and it will work (for example: ./pykms_Server.py ::1 1688 - will listen on loopback interface ip v6 ::1 and ./pykms_Server.py <IP_ADDRESS> 1688 - will listen on loopback interface ip v4 <IP_ADDRESS>), but as it stands right now there is no way to use both at the same time (dual stack), because for IP it only takes only 1 argument. Also default option (<IP_ADDRESS>), only listens on all interfaces IPv4 only and skips IPv6 listening... sure i could run 2 pykms_Server instances both listening on different ips, but it shouldnt be that hard, also since i run py-kms in docker, i would need to run 2 py-kms docker containers or write my own...
Would be nice to have ability, to set server to listen on multiple ips in the same instance and have default option to listen on all ipv4 and ipv6 addresses on all interfaces.

Actually its possible to specify more ips... something along this lines:
./pykms_Server.py 84.xxx.xxx.xxx 1688 -l 1033 -c 26 -a 120 -r 10080 -w RANDOM -V INFO -F STDOUT connect -n <IP_ADDRESS>,1688 -n 2a01:xxx:xxxx:xxxx::1,1688,
bit clumsy :) now need to figure out how to add this in to docker without rebuilding it...

cc @simonmicro

Tried to "extend" docker LOGFILE env variable with -e LOGFILE="STDOUT connect -n <IP_ADDRESS>,1688 -n 2a01:xxx:xxxx:xxxx::1,1688", but it errors out with: argument -F/--logfile: invalid directory: 'STDOUT connect -n <IP_ADDRESS>,1688 -n 2a01:xxx:xxxx:xxxx::1,1688'. Exiting...
hm... dont think its possible how docker container is set right now, i think we would need another env variable for example "CUSTOM_OPTIONS" that would append whatever you put in to it at the end of pykms_Server.py command...

I dont understand, i created new env variable for docker, changed start.py to add connect that enviroment variable at the end (like i had it working outside docker container) and now im getting this error:
Sun, 03 Apr 2022 17:03:39 INFO     Log level: DEBUG
Sun, 03 Apr 2022 17:03:39 INFO     Setting gid to '65534'.
Sun, 03 Apr 2022 17:03:39 INFO     Setting uid to '65534'.
Sun, 03 Apr 2022 17:03:39 DEBUG    server_cmd: /usr/bin/python3 -u pykms_Server.py 84.xxx.xxx.xxx 1688 -l 1033 -c 26 -a 120 -r 10080 -w RANDOM -V DEBUG -F STDOUT connect -n <IP_ADDRESS>,1688 -n 2a01:xxx:xxxx:xxxx::1,1688
unrecognized optional connect arguments: -n <IP_ADDRESS>,1688 -n 2a01:260:4085:1000::1,1688. Exiting...
obviously server_cmd seems fine, i dont undestand why its working outside docker container in my python enviroment, but inside it errors out...
This is outside docker in my own python env:
mih ~/py-kms/py-kms # ./pykms_Server.py 84.xxx.xxx.xxx 1688 -l 1033 -c 26 -a 120 -r 10080 -w RANDOM -V INFO -F STDOUT connect -n <IP_ADDRESS>,1688 -n 2a01:xxx:xxxx:xxxx::1,1688
Sun, 03 Apr 2022 17:09:54 INFO     TCP server listening at 84.xxx.xxx.xxx on port 1688
at <IP_ADDRESS> on port 1688
at 2a01:xxx:xxxx:xxxx::1 on port 1688
Sun, 03 Apr 2022 17:09:54 INFO     HWID: 86C01601ECD24FE
someone smarter then mee needs to figure this out :)

Hi,

Docker creates an isolated network namespace for every container. Please take a look into that (tip: network_mode: host).
Linux allows an IPv4 to connect to any IPv6 port thanks to address mapping / translation. Go ahead and test it! -> Meaning listening to :: should be enough.
For specific network restrictions please utilize the firewall capabilities of your setup (e.g. iptables for Linux).

Greetings...

Hey,

I know, im using host
yes if you set as IP :: server listens for traffic on all ipv6 interfaces, but not on ipv4 again problem is you would need to set <IP_ADDRESS> and ::

anyway i had some time, so i lerned some basic python, didnt go that far to change pykms_Server code but i fixed start.py to allow multiple IPs in docker eviroment variable: #238af40309f141d385517c76f2ab4503d29849ab


FATAL {agency} Failed to load persistent state on startup.

After a restarting of one box of the cluster, the agent seems bad and cannot startup normally.
`
2019-06-05T16:32:18Z [66065] INFO {authentication} Authentication is turned off, authentication for unix sockets is turned on
2019-06-05T16:32:19Z [66065] INFO using endpoint 'http+tcp://<IP_ADDRESS>:8531' for non-encrypted requests
2019-06-05T16:32:19Z [66065] INFO ArangoDB (version 3.4.5 [linux]) is ready for business. Have fun!
2019-06-05T16:32:20Z [66065] FATAL {agency} Failed to load persistent state on startup.
End of agent log component=arangodb
2019-06-06T00:32:20+08:00 |ERRO| agent has failed 100 times, giving up component=arangodb
2019-06-06T00:32:20+08:00 |ERRO| agent has failed 100 times, giving up component=arangodb
2019-06-06T00:32:20+08:00 |INFO| Shutting down services... component=arangodb
2019-06-06T00:32:22+08:00 |INFO| coordinator has terminated component=arangodb
2019-06-06T00:32:24+08:00 |INFO| dbserver has terminated component=arangodb
`

Hi @daoxian ,
Would you please start the agent with --log.level trace and provide the output?
Best, Kaveh

Let me try later, now the env is not ready.

I think I've figured out the way to restart it by starter. Thank you anyway.

Excuse me，can you tell me the answer about it?

Facing the similar issue while user arango starter to start the cluster

We are experiencing similar issue on an EKS deployment. Agent is stuck in a loop. We have used Arango Operator to deploy the cluster. Agent is stuck in a loop. Any fix?
Arango Version: 3.7.3
Deployment via: ArangoOperator
Agency Size: 3
Coordinators Size: 3 max 9
Database Nodes: 3 max 9
Error Log from the troubled pod
2021-03-20T19:28:03Z [1] WARNING [49528] {memory} execute 'sudo sysctl -w "vm.max_map_count=256000"'
2021-03-20T19:28:03Z [1] INFO [144fe] using storage engine 'rocksdb'
2021-03-20T19:28:03Z [1] INFO [3bb7d] {cluster} Starting up with role AGENT
2021-03-20T19:28:03Z [1] INFO [6ea38] using endpoint 'http+ssl://[::]:8529' for ssl-encrypted requests
2021-03-20T19:28:03Z [1] INFO [a1c60] {syscall} file-descriptors (nofiles) hard limit is 1048576, soft limit is 1048576
2021-03-20T19:28:03Z [1] INFO [3844e] {authentication} Authentication is turned on (system only), authentication for unix sockets is turned on
2021-03-20T19:28:04Z [1] INFO [e6460] created base application directory '/var/lib/arangodb3-apps/_db'
2021-03-20T19:28:04Z [1] INFO [cf3f4] ArangoDB (version 3.7.3 [linux]) is ready for business. Have fun!
2021-03-20T19:28:05Z [1] FATAL [9b680] {agency} Failed to load persistent state on startup.

Any thoughts?

Hi,
please upgrade to Arangodb 3.7.10 and check whether the issue persists.


mini_event.h (4.3.2 and 4.3.1) on OpenBSD cannot find fd_set - patch

--- ./mini_event.h.orig	2020-06-22 16:28:12.000000000 +0200
+++ ./mini_event.h	2020-06-22 16:29:23.000000000 +0200
@@ -73,6 +73,9 @@
 /* needs our redblack tree */
 #include "rbtree.h"

+/* for fd_set on OpenBSD */
+#include <sys/select.h>
+
 /** max number of file descriptors to support */
 #define MAX_FDS 1024
 /** max number of signals to support */

Thanks for the fixup, merged the fix.


The OutputPath property is not set for project 'Platform.sfproj'.

After update Visual Studio 2017 to 15.1 (26403.0) I can't build my Service fabric solution:

Severity	Code	Description	Project	File	Line	Suppression State
Error		The OutputPath property is not set for project Platform.sfproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='x64'.  This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Configuration or Platform.	Deezze.Platform	C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets	737

For all of my projects I have targeted paltform like
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
   <PlatformTarget>x64</PlatformTarget>
 </PropertyGroup>

 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
   <PlatformTarget>x64</PlatformTarget>
 </PropertyGroup>

Also while solution is loading message "The project must have its NuGet packages restored in order to work correctly. Would you like to do that now?" appears every time when I press "Yes" button.
Please suggest some solution for that

The issue was moved to https://github.com/Azure/service-fabric-issues


Update Ondat addon version

What does this PR do?
This PR upgrades the Ondat addon to the latest release, 0.1.0. This installs v2.7.0 of Ondat, now with etcd in-cluster using GP3 volumes for backing store in the default blueprint with additional ephemeral storage and external etcd examples.
Motivation
New features for Ondat addon.
More

[x] Yes, I have tested the PR using my local account setup  (Provide any test evidence report under Additional Notes)
[ ] Yes, I have added a new example under examples to support my PR
[x] Yes, I have created another PR for add-ons under add-ons repo (if applicable)
[ ] Yes, I have updated the docs for this feature
[ ] Yes, I ran pre-commit run -a with this PR

Note: Not all the PRs required examples and docs except a new pattern or add-on added.
For Moderators

[ ] E2E Test successfully complete before merge?

Additional Notes
N/A

Thanks @askulkarni2, I've addressed the issue!


Compare average processing time for validator between 5.0 and 6.0

Describe the problem
In order to be confident that the new column additions to stop_times.txt with Flex are not having a significant impact on the validator's performance, we want to compare the average runtime for the validation between 5.0 and 6.0.
Proposed solution
Include analytics about how long run time was in 5.0 vs. 6.0 for each feed.
Alternatives you've considered
No response
Additional context
No response

Method
How the running time was extracted:

Restored the beach feat/1698 base branch of #1771. In this PR, the time validationTimeSeconds was introduced to the JSON report. There were no significant changes from 5.0.1 to this branch.
Created a PR with a branch based from feat/1698 to gather all JSON reports that includes the new field validationTimeSeconds. This PR had to be against a similar branch due to a limitation in GitHub that blocks automation to run when conflicts are present, more info.
Created a Python script locally to compare metrics of the latest master acceptance tests with the one extracted from feat/1698(close to 5.0.1). The script also looks for the most significant changes in time consumption across all feeds.
The Java memory max heap was increased to 12GB to avoid impacting the metrics due to crashing validators.

Results
Time performance metrics

Metric
5.0.1
Master
Difference

Average
3.93
4.04
0.11

Median
1.38
1.43
0.05

Std Dev
11.07
11.55
0.48

Min
feed_id: us-florida-citrus-county-transit-gtfs-630, time: 0.517
feed_id: us-oregon-high-desert-point-gtfs-636, time: 0.540
0.023

Max
feed_id: gb-unknown-uk-aggregate-feed-gtfs-2014, time: 289.510
feed_id: gb-unknown-uk-aggregate-feed-gtfs-2014, time: 298.620
9.110

** All values are expressed in seconds
There is a minor increase in the metrics but not a significant increase.
Feeds with the most significant increase
In the following chart, there is a list of the most significant changes in time filter out all the changes less than 5 seconds to reduce noise.

Only six feeds differed by more than 5 seconds, and one of them reduced time.


chore(testing): add . export

This change adds the . export for @std/testing. While the package is fine in it's current state without this export, it's likely better to have the . export rather than not, for a few reasons:

It allows users to import multiple symbols from @std/testing using a single import specifier. Such use cases exist in the Standard Library itself, and have been updated as part of this PR.
It allows the doc checker to check testing/mod.ts. This previously wasn't the case for testing/README.md.
It's consistent with the 36 out of 37 other packages across the Standard Library (except @std/fmt), which include mod.ts files. AFAIK, there's nothing unique about @std/testing that sufficiently justifies having it be treated different.
It removes the special treatment of the package in scripts in _tools.

I'm not aware of any sufficiently strong reasons against having a . export in this package.

I'd prefer to keep the current structure. Because @std/testing have more variety of purposes than other std packages, the list of APIs exported from @std/testing seem a bit too chaotic to me with this change.
I think this issue is motivated by the discord thread https://discord.com/channels/684898665143206084/1258496628923564053, but this seems cause by CLI bug, and it's not a std design issue.

This PR enables multiple symbols within @std/testing in a single import. But it does not somehow inhibit users from importing from individual modules. Also, while that Discord thread triggered me to rethink about this package, but it is not the primary reason behind the change. That's why I deliberately didn't reference it in my opening comment.
I can't convince myself to share your concern. It seems minuscule compared to the benefits outlined in the initial comment.

I only see the maintainer's benefits in this change. Also this was never asked or suggested by the users.
BDD testing, mocking, snapshot testing, asserting types are quite different categories of test utilities, and also they export relatively large number of APIs (especially bdd, mock and types). Exporting all of them from single endpoint feels chaotic to me.

There are plenty of examples of us making changes without user request. Yes, this mainly benefits the maintainer, but costs the user nothing. Nothing is stopping them from importing from the most-specific location. As seen by the changes within our own codebase in this PR, it's not impossible that someone wants to import more than one module from @std/testing.

but costs the user nothing.

In my view, the cost here is a bit confusing and chaotic default namespace in API docs, which list all different kinds of APIs in alphabetical order. In my view that namespace is better not  existing. So this change looks having slight negative effect in doc readability to me

Fair point. To summarise, these are the pros and cons.
Pros:

Allows users to import from multiple @std/testing modules in a single import statement. Users are still able to import from modules directly.
Allows doc checker, in it's current state, to check testing/mod.ts.
Makes the package consistent with 36 out of 37 other packages in the codebase.
Removes special handling of the package with scripts in _tools.

Cons:

Introduces a large default module.

Closing, as I don't think this is worth the hassle.

The downside that makes me agree with @kt3k is that people may use asserts in non test code, and having a single import for all will likely result in people unintentionally importing a bunch of test modules they don't need into their applications.

The same could be said for the root (default) module of any package in the Standard Library.

The same could be said for the root (default) module of any package in the Standard Library.

The only difference is that other modules in @std/testing besides assert would never normally be used outside the context of tests so importing all of them is guaranteed to be unnecessary. While you could have a reason to import all of some other modules, like if you know your application is going to be using most of the modules included.

I had taken a break for a while from Deno, I just noticed that assert was moved to it's own top level std module. That kind of nulls the point I was making about how people might be importing @std/testing just for the assertion functions. I think the only reason people would import @std/testing now is for use in tests, so actually I am now in favor of their being a main entrypoint for importing all of @std/testing.


extract mecharashi assets error

As shown in the picture, there was an error in extracting the assets, maybe they changed the UnityCN key?
sample：https://drive.google.com/file/d/1lwIZG5LwnsslqEB7jpZNg9DZpYUOtYHl/view?usp=share_link
Official website: https://ma.zlongame.com/ （It starts testing pre-downloads today）

your link didnt include metadata , and what make you think it is unitycn? and if so what key you picking

Because it is recorded in the keys.json file of the UnityCN key

this metadata file link : https://drive.google.com/file/d/19GEs3Svzh6_R93AsR7h3jAjXzUbEiVNT/view?usp=share_link
I'm not very good at programming stuff so I'm trying to ask for help🙏🏻

This is the command I executed in the terminal
AssetStudioCLI.exe "Z:\Rikka\Downloads\Unpack Games\钢岚_2.4.0\ExportAssetBundle" "Z:\Rikka\Downloads\Unpack Games\钢岚_2.4.0\output" --game UniyuCN --key_index 7

should be<PHONE_NUMBER>3543423144313841304630 , you can close the issue if it works for you

should be<PHONE_NUMBER>3543423144313841304630 , you can close the issue if it works for you

It's working fine, thank you very much for your help🥰


Fix crash on pre-Lollipop devices

Restore sdk version check

Duplicated: https://github.com/ozodrukh/CircularReveal/commit/bad790ae906850dae0a682ef7bbc7813486dcc40

Thank for pull request @devslava
@imknown Thanks for review


Use SigningAlg instead of uint256 in Sapphire.signDigest

to be consistent with generateSigningKeyPair and verifyDigestSignature.

This shouldn't be merged, identified that the Sapphire.sol doesn't match the implementation in https://github.com/oasisprotocol/oasis-sdk/blob/main/runtime-sdk/modules/evm/src/precompile/confidential.rs
Am making working tested example for the different signing algs, then will update Sapphire.sol and documentation to match.


Package core-crm deploy in Dev failed

Action run

Tabs moved from core-crm to src-ui, as some tabs are dependent on flexipages


Listen to root routes as well

Description
Navigation doesn't work on hac routes. There's a problem that current chrome doesn't have new basename and so it doesn't send nav changes to hac application with hac prefix.

ping @vojtechszocs @Hyperkid123 @florkbr

lgtm

/lgtm


docs: update readme with android build badge

:warning: Please install the  to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.84%. Comparing base (6bb4e7a) to head (3d9dbaf).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #60   +/-   ##
=======================================
  Coverage   94.84%   94.84%
=======================================
  Files          12       12
  Lines         233      233
  Branches       26       26
=======================================
  Hits          221      221
  Misses          7        7
  Partials        5        5

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


Error when loading custom JS files in SPFX webparts

Category

[# ] Question
[ ] Typo
[# ] Bug
[ ] Additional article idea

Expected or Desired Behavior
External JS files should be easily used inside the spfx webparts
Observed Behavior
The JS files bundled & referred from the externals section of the config.json file in my spfx solution is not loading properly in the browser
Steps to Reproduce
Following is my code in  config.json external section:
"externals":
{
"jq":{
"path":"./sharepoint/assets/assets/js/jquery.min.js",
"globalName":"Jq"
},
"customjs":{
"path":"./sharepoint/assets/JS/Custom.js",
"globalName":"Jq",
"globalDependencies": ["jq"]
},
"bootstrap":{
"path":"./sharepoint/assets/assets/js/bootstrap/js/bootstrap.min.js",
"globalName":"Jq",
"globalDependencies": ["jq"]
},
"cookie":{
"path":"./sharepoint/assets/assets/js/js.cookie.min.js",
"globalName":"Jq",
"globalDependencies": ["jq"]
}
This is how i am referring these JS files in my SPFX webpart Code:
require('jq');
require('customjs');
require('bootstrap');
require('cookie');
I am running the command gulp bundle --ship to bundle them & uploading them inside a document library in the site assets and referencing it from there
But when i load the page for the first time, on which the SPFX webpart is added i get the below error:
Uncaught (in promise) Error: ***Failed to load path dependency "bootstrap" from component "96dccf5d-b80b-40a2-8f54-04c88ef4432f" (AwaitingActionWebPart).
Original error: Error loading https://component-id.invalid/96dccf5d-b80b-40a2-8f54-04c88ef4432f_0.0.1/bootstrap
Evaluating https://demo1000.sharepoint.com/sites/service-center/SCJS/bootstrap_5869c96cc8f19086aee625d670d741f9.js
Jq is not defined
at t [as constructor] (sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:201)
at new t (sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508)
at Function.e.buildErrorWithVerboseLog (sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508)
at Function.e.buildLoadPathDependencyError (sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508)
at sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508
at sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508
at
Uncaught (in promise) Error: ***Failed to load path dependency "customjs" from component "96dccf5d-b80b-40a2-8f54-04c88ef4432f"
Original error: Error loading https://component-id.invalid/96dccf5d-b80b-40a2-8f54-04c88ef4432f_0.0.1/customjs
Evaluating https://demo1000.sharepoint.com/sites/service-center/SCJS/customjs_4e91343aa84c05470ea8e445298b7555.js
Jq is not defined
at t [as constructor] (sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:201)
at new t (sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508)
at Function.e.buildErrorWithVerboseLog (sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508)
at Function.e.buildLoadPathDependencyError (sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508)
at sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508
at sp-classic-page-assembly_en-us_d52a0a02ea478feb7eee9b6c87bd0885.js:508
at
And the Custom.js files doesn't gets loaded/called. Can someone kindly help me with this issue?
Thanks in advance :-)
Also i would like to know the solution for this issue which i might face it in future
https://github.com/SharePoint/sp-dev-docs/issues/472

Hello Everyone,
I found my issue, in the externals section i was using relative URL which was causing it not to load the referred JS files. So in the externals section i'm suppose to use only cdn path or the path which is referring to a file online. Thanks anyways, closing the issue.


Add HTTP method option to actionWebInvoke

The actionWebInvoke method in web-src/utils.js provides the OOTB functionality to invoke web action. It uses POST requests for everything.
In reality some requests are much better to be GET, e.g. by using cache-control to cache HTTP response. Therefore, we could make the actionWebInvoke method more flexible to support other HTTP methods, esp. GET.
For example: async function actionWebInvoke (actionUrl, headers = {}, params = {}, method = 'post')

Thanks for the suggestion, @duynguyen !

I think using POST for all requests is not right.
To keep things simple, we could switch between POST and GET based on params passed.
If there are no params passed we can use a GET else use POST

yes +1 @rajarju !


Dashboard - My Account - Delete Button [Due 2/27]

Go to : Home Page -> Dashboard
Click Delete

Pop Up "Are You Sure" window.
If user click No, the popup window disappear.
In user click Yes, delete the User. You can hard code a User Id that exist in the user table in database.
Verify that the status of the user is changed to "Deleted".

This issue was moved to Code4SocialGood/c4sg-web#67


Expose sort by field in query

Query and sort by a field? @RangerMauve

Yup, so right now we have a way to use indexes for searching for items that equal a specific value. A good extension from there would be to have GreaterThan and LessThan fields that work similar to Equal but do > and < comparisons.
As well there should be a way to specify a Sort field in the Query to choose which field to try to sorty by. Sorting is a bit tricky because you need the sorted field to be at the start of the index array. E.g. if you want to sort by date you need to have an index that looks like ['date','whateverElse']. However when you have Equals fields they can come before the sort field since you can quickly seek to that type and skip others. e.g. an index that looks like [type, date, somethingElse]could satisfy the queyy{Equals: {type: "example"}, GreaterThan: {date: today}, Sort: "date"}`.
This is the approach I took in hyperbeedeebee and the algorithm for choosing the best index for a query can be found here: https://github.com/RangerMauve/hyperbeedeebee/blob/default/index.js#L315


Git: status bar lacks indication that it will push

VSCode Version: Code - Insiders 1.3.0-insider (a2b9738a942237b59cb920940b93a0206f1b61d0, 2016-07-01T19:26:22.011Z)
OS Version: Darwin x64 15.5.0

Steps to Reproduce:

Create commit, ready to be pushed
Click on Git part of status bar
-> Commit is pushed, which is unexpected

Not a regression (also in 1.2.1).

There are two actions in the status bar:

The first one will only list and let you check out branches. The second one is the sync action which will pull and push.
I am very reluctant in adding a confirmation dialog when clicking the sync action. If there are no better suggestions, I suggest to close this as designed.

Actually, #2397

"Synchronize" isn't clear on what it will do. I initially assumed it would just fetch (or pull) and was surprised it pushed.
Is there telemetry on how often these actions are used? I'd guess that pull (and pull with rebase) are used more often than push or sync.

Since they are actions, we do have telemetry for it. Hey @seanmcbreen can we get some rough numbers here?

@joaomoreno: I'm concerned about the first-timer experience. I was trying all actions in the status bar as part of our smoke test and didn't expect anything to happen without me being aware of it beforehand. I then inadvertently pushed a bogus change.
First-timers won't have the confirmation enabled. The confirmation doesn't help in that regard as long as it's disabled by default. I'm not necessarily suggesting to enable it by default, although that might be one option to avoid having this surprise.

Also: "Synchronize" is not a well-understood term for someone familiar with git where "pull", "rebase", "merge", "push" are common.

I have never seen an action that can be this destructive without a confirmation prompt.
No one on my team likes this sync button behavior. It does some weird combination of pull auto resolve and push. If I had ten votes I'd use them all to just remove this button altogether.
Right now it gets accidentally clicked by some team member and our entire branch gets into a messed up state. This is easily our least favorite part of an otherwise great ide.

@madjos It literally runs git pull followed by git push, no further weird magic.
There is now a "git.confirmSync" which your team can set to true that will cause a confirmation dialog to come up every time the action is clicked. This is already released in the Insiders build and will be released in the July stable release.

@chrmarti Agree with the synchronize term. I believe it was brought up 4 years ago when git wasn't known by most of our clients (Monaco) and we wanted a term people could relate to.
What we could do, once the work of programmatically changing the user settings is in, is to always prompt the user but give him a checkbox to never prompt him again. This choice would then be remembered in the git.confirmSync user setting.

(Reopening for the discussion about the Sync action not properly indicating what it will do.)
Another option might be to replace the Sync action with the Push action, so the user's expectation are set correctly. To retain the current functionality when there are remote changes, the Push action could ask for confirmation to first Pull and then Push, but only if remote changes exist. This would have the advantage of only showing a confirmation dialog when it matters. CC: @egamma @chrisdias

Could the button be redefined as "performs a configured series of git commands"? The default series of commands could be today's behavior. But then I could do what I want, which is, git stash 'vscode-sync', git fetch --all, git rebase, git stash pop, bailing out of any command fails. Note that my example here doesn't push, but also doesn't pull. I can't use today's button at all, but I'd love to be able to. Currently this process is a custom git alias (or, almost is).

Fixed by 96010725e5b3e3035174b0cfc85898add1d79159

@joaomoreno @chrmarti Am late to the party, but how about changing the tooltip from "Synchronize Changes" to "Pull and push changes" ?

cc @chrisdias @egamma @gregvanl on the wording

Related: #13360 asks for renaming the command.


Include timing of beforeEach in test duration

Description of the Change
As noted in #419 it is sometimes desirable to include the duration of any beforeEach/setup hooks in the duration of tests. This PR adds an option --time-setup which allows this. The --time-setup option is helpful when looking to discover slow tests, where the setup makes up a significant portion of the total duration. Without this option, the user has no visibility into the time being spent in setup. The --time-setup option can be combined with --slow to find tests that exceed a slow threshold.
Alternate Designs
Alternative designs:

Include detailed timing about all hooks and allow plugins or reporters to decide what to do with the timing information. The existing duration attribute would not need to be redefined.
Add pseudo-tests for timing of before()/after() hooks #3368.

The design implemented in this PR has the advantage of being compatible with existing tooling and the --slow feature. For users who want to opt in to measuring beforeEach hooks, all existing test reporters can display this redefined duration in place of the normal tests-only duration. The alternatives described above could make this feature obsolete, but are significantly larger scope.
Alternative option names:

measure-before https://github.com/mochajs/mocha/issues/700
include-before-each
include-setup-time
before-each-timing

I'm open to renaming the option.
Why should this be in core?
Mocha does not expose a mechanism for a plugin to extend or override how the duration of each test is calculated. Detailed timing information is not available for tests.
Benefits
Users are able to detect slow beforeEach hooks and better understand the overall performance of their test suites.
Possible Drawbacks
Increased complexity. Yet another option to document, understand, and maintain.
Applicable issues

Fixes #419
semver-minor

Coverage increased (+0.09%) to 91.765% when pulling bd5a0a63d2ac07090e5676c8d639c6ab12010faa on TwineHealth:include-before-each into 00a895f6ad9c1e4c5500851d6ff875e8254a5e06 on mochajs:master.

@kevinburkeshyp Could you please sign the mocha Contributor License Agreement so that your commit can be accepted as part of this PR? Thanks!

I believe I have other commits to this project already? Are they not sufficient?

I signed as kevinburke /<EMAIL_ADDRESS>I don't have access to the<EMAIL_ADDRESS>email address used for the first commit.
You have my blessing to just cherry pick the commit contents and change the author, a note (originally suggested by Kevin Burke) or something in the commit message would be appreciated!

Make that 2/3 commiters have signed the CLA.

For what it's worth, think Mocha should have a stats.timing object that collects durations for all suites, tests, hooks implicitly.

I recreated the branch by cherry picking the commit from<EMAIL_ADDRESS>changing the author to<EMAIL_ADDRESS>Looks like the license/cla check is passing now.

@boneskull Capturing timing details on stats sounds desirable, and using a new or modified reporter to then see the complete timing information would potentially address many use cases. However, I think it is important to support the behavior implemented in this PR, and enable a way to actually change the duration of each test, so that existing reporters (and the --slow feature) will include the time from any setup hooks. It is valuable to be compatible with existing reporters, including the one I use in my IDE.
Given that there does not appear to be a plugin API yet for mocha https://github.com/mochajs/mocha/issues/1457, I don't know how I would accomplish this without making a change to set the duration in the core of mocha. Any suggestions for a way to provide existing reporters with duration that includes time from setup hooks?

@boneskull I'm looking for some feedback on my response to your concerns so that I know how to proceed. As I stated I'd like to figure out a path to being able to include time for setup/beforeEach hooks in the duration seen by existing reporters and --slow.
Are you suggesting that you will not accept some form of this enhancement into mocha? Or is there some way to rework this to be compatible with the vision for stats.timing suggested by @plroebuck?
Perhaps it would be possible for a reporter to modify duration. Would this be appropriate? Is there a good/supported way to enhance mocha in this way without patching the core?

@sgilroy Making any built-in reporter report this information is going to be semver-major, and doesn't need to be part of this PR, which would be to just collect these statistics so a) built-in reporters could eventually use them, and b) a custom reporter could use them immediately.
To expose this information, you'll want to do something like this:

Create an e.g., appendHookDuration method on Test.  This function should be invoked after each Hook has completed execution against its ctx.currentTest property, passing the Hook's duration property.  This method should increase the value of some numeric internal property within Test, or use some other data structure.  Careful to reset the value if a test needs to be retried.
Create a method on Test to retrieve the hook duration (a getter)
Tests, of course

To use this information with a reporter, you'd create a listener on the Runner's EVENT_TEST_END event, which receives a Test object as its parameter.  You can then get the hook duration(s) by calling your getter.  From within this listener, you could add the hook duration(s) to the duration property of your Test.  Then output the info as you like.
Please let me know if the above is what you were looking for.

(See the json reporter for an example of how to collect information about the tests and output it when the run is complete)

@boneskull I don't understand why you are asserting that "Making any built-in reporter report this information is going to be semver-major". The modified behavior is only effective if the option (currently --time-setup) is specified, so there is no breaking change.
You had previously implied (in 2016: https://github.com/mochajs/mocha/pull/2244#issuecomment-225394691) that putting this behavior behind a flag and adding tests (which I have done) would be sufficient to get a PR like this accepted. I appreciate that it would be desirable to have more flexible, detailed timing information available but I am not prepared to implement the solution you described right now, and it would not accomplish my stated objective:  include the duration of any beforeEach/setup hooks in the duration of tests, as seen by all reporters (not just a custom new one). I use multiple existing reporters for different purposes, and I like the format and content of the output; I just want to change what is included in the duration.
I believe this optional alternative definition of duration would be useful to other developers and teams as well. See #419, #700, and #1975, and articles such as Speeding up Javascript Test Time 1000x and Speeding Up Your JavaScript Test Suite which talk about the importance of the duration of setup hooks. Seeing where time is being spent (including setup time) is an essential part of making tests run faster (and keeping them fast) and currently mocha provides no visibility into the time for beforeEach/setup hooks.

For those wanting this kind of feature, I have come up with a hack way of adding it by using a hook:
let start = performance.now()
export const mochaHooks = {
    beforeEach: async function () {
        const currentTest = this.currentTest
        const originalRun = currentTest.run
        currentTest.run = function (fn) {
            originalRun.call(currentTest, function (...args) {
                const end = performance.now()
                currentTest.duration = Math.round(end - start)
                start = end
                fn(...args)
            })
        }
    }
}

It's put into a --require file which adds a global hook.
I have made it such that start is set immediately and updated after each test, this ensures all time spent between tests are included, so any before / beforeEach / after / afterEach etc. is counted in the duration.
It's kind of hackish, but works.

👋 coming back to this @sgilroy, are you still interested in working on this PR? As of https://github.com/mochajs/mocha/issues/5027 there are again maintainers who can review it now. No worries if you no longer have time - but if you do that'd be great!
I do see that your last message was discussing semver majoring of it - once we're ramped up we can pick up that thread of conversation.

Closing as it's been ~3 months. If anybody wants to pick up this change and re-uses code from this PR, please add a co-author attribution to the body of the PR. Cheers all! ☕ 🤎


nbdev_clean not working

When I run nbdev_clean --disp, I get the following error messages (and the notebooks are not cleaned):
/home/krisztian/miniconda3/envs/noki/lib/python3.8/site-packages/nbdev/clean.py:110: UserWarning: Failed to clean notebook
  warn(f'{warn_msg}')
/home/krisztian/miniconda3/envs/noki/lib/python3.8/site-packages/nbdev/clean.py:111: UserWarning: expected str, bytes or os.PathLike object, not _io.TextIOWrapper
  warn(e)
/home/krisztian/miniconda3/envs/noki/lib/python3.8/site-packages/nbdev/clean.py:111: UserWarning: expected str, bytes or os.PathLike object, not _io.TextIOWrapper
  warn(e)

I'm using version 2.1.3 (latest on pip).  Whether git hooks are installed or not make no difference.
Anyone else encounter this?

I was wrong, the notebooks are actually cleaned (but still getting the warnings)

This seems like it could be a legitimate issue (erroneous warnings) do you want to reopen it and maybe change the title?

I'll investigate a bit to make the issue more useful. It seems like some of the notebook magic commands that are throwing off nbdev_clean, but I'm not sure yet.