A way to keep backend errors with client validation

Here is a simple form with errors example:
name - no error
surname - no error

When I submit form, I receive backend errors: { surname: 'Exists' }. So, I set field errors and now they are:
name - no error
surname - 'Exists'

Now, if I change or blur the value of the name field, the whole form validation will be triggered and backend error will be erased for surname field.
How is it possible to erase field's backend error only if the value of that field was changed?
 The problem is that when you change/blur one of fields, all other backend errors are gone since newly triggered validation will erase them.

We use option 1, and pass around a small helper function.

@jaredpalmer here is a codesandbox demo of what I mean.
Set the values of email and username, submit the form and you'll receive 2 backend errors. Now, change the value of blur one of the fields - all backend errors will be gone.

Hmmm yeah not ideal.
Need to think about this one.

Possible solution - add submitErrors object where you store submit errors. This way, submitErrors won't interact with client-side errors and can be handled separately.

Currently we handle such errors via setStatus. In our case it doesn't prevent form submitting and they're not cleared away even if related field was updated.
But in general case, after setting such errors from outside - each field should hold its own errors until blur/change event.

@VladShcherbin this use case is tough, and I think the best way to deal with this is to actually have two separate feedback components that render error messages for each input. First attempt, show regular error/touched errors. If there are then API errors, keep them in status.errors. Then show those  instead during the second attempt.  That way, regular validation won’t overwrite them.

@jaredpalmer nah, other libraries can handle this use case.
I'm sure, we'll find a nice way to deal with this too 😉

@amankkg I had the same problem. I use setStatus to set server side errors, but I wanted those errors to disappear after a give field is changed. Here is my solution:
<Field
  type="email"
  name="email"
  onChange={(v) => {
    if (status && status.email) {
      const { email, ...rest } = status;
      setStatus(rest);
    }
    handleChange(v);
  }}
/>

If this pattern was repeated, you could reuse similar logic in your custom Field component.

workaround ≠ solution
This is a rather really common use case and I think Formik could solve this in a much neater way.
I think this issue should be reopened.

Feel free to submit PR’s open to exploring this

yep, instead of fixing/adding things let's just close issues like nothing happened. not even surprised to see this bot here 😄

@vladshcherbin thanks!

@vladshcherbin I wish I had time to go through it all but I don't. So rather than continue to let things pile up, I figured I could make small dent with this bot. If people still need help they will holler (just like you just did!).
This feature is planned in v2 #828

just lol

There are 2 parts to this:

catching submit errors (which also requires async onSubmit)
storing backend errors and displaying them to the user

For 2, as described, you can use status to store the data and then in your render function figure out what to show. FWIW status used to be called error (singular) and was intended for this use case.
It's awkward in v1, but will be less so in v2:
function Fieldset({ name }) {
  const { status } = useFormikContext()
  const [field, meta] = useField(name)
  const apiError = getIn(status, name);
  return <>
    <input {...field} />
    {meta.touch && (meta.error || apiError)  &&
{meta.error || apiError}
}
  </>
}```

However, if we implement async submit AND error handling in v2, we would need to introduce a new key so as to not mess with people's existing usage of `status`.

Is this possible in v2 now?

@fivethreeo @jaredpalmer wondering this too

I am also wondering if this is possible in v2.
Does anyone have a good workaround for v1, if I am to only care for server-side validation?
I have a workaround by using setFieldError during handleSubmit and resetting individual field errors during field's onChange..

For anyone else coming to this thread and being none the wiser, I found @jaredpalmer gave an answer on SO that solved my wondering how this is done (in v1).
https://stackoverflow.com/questions/52986962/how-to-properly-use-formiks-seterror-method-react-library
Snippet:
onSubmit={(values, { setSubmitting, setErrors }) => {
                        const axios = getAxiosInstance();

                        axios.post('/reset/', {
                            'email': email
                          }).then((response) => {
                            setSubmitting(false);
                          }).catch((error) => {
                            setSubmitting(false);
                            const fieldErrorsFromResponse = error.response.data.field_errors;

                            // fieldErrorsFromResponse from server has {'field_errors': {'email': 'Invalid'}}
                            if (fieldErrorsFromResponse !== null){
                              setErrors(fieldErrorsFromResponse);
                            }
                          }
                        );
                      }}
                      render={({ isSubmitting, errors }) => (

                        <Form className="form-horizontal">

Enter the email address associated with your account, and we'll email you a link to reset your password.

                          <FormGroup>
                            Email address
                            <Field type="email" name="email" />
                            <ErrorMessage name="email" component="div" className="field-error" />
                          </FormGroup>

If someone needs a bigger example for copy'n'pasting the idea from @jaredpalmer mentioned in https://github.com/jaredpalmer/formik/issues/150#issuecomment-447147835 here is a gist:
https://gist.github.com/donaldpipowitch/4f3989edb2aadd9e44c2856c65e90b2e
Here you can find two hooks to retrieve and reset server side errors properly. The hooks either look for  field specific errors (setStatus({ field: 'Your error message' }) or global errors (setStatus(true)).

I made an example that can make life easier for some people. follow the link more this looks like a hack
https://codesandbox.io/s/formik-api-errors-9xwjs

Anyone know the best way to handle this with sagas?
My form calls a submit function with the form's values:
<Formik
  initialValues={{
    email,
    password: "",
    passwordConfirmation: ""
  }}
  validationSchema={ValidationSchema}
  onSubmit={(values, { setErrors, setSubmitting }) => {
    const { password, passwordConfirmation } = values;
    submit(token, password, passwordConfirmation);
  }}
>

submit dispatches an action that starts a request:
const mapDispatchToProps = dispatch => ({
  submit: (token, password, passwordConfirmation) => {
    dispatch(setPasswordRequest({ token, password, passwordConfirmation }));
  }
});

There's then a "loading", "success", and "failure" action that corresponds to setPasswordRequest. The errors and loading state are managed in the Redux store.
But in order to set a form's errors and loading state with Formik, you need to use  setErrors and setSubmitting from the Formik.onSubmit prop.
I could pass setErrors and setSubmitting to setPasswordRequest and call them in the saga, but that seems messy. Anyone know the best way to approach this?

Here is what work weel for me.
Quite similar to @t-nunes example, but without changing statuses until next submission.
Examples for both versions

v1.* https://codesandbox.io/s/backend-validation-formik-demo-v1-1ej5q

v2.* https://codesandbox.io/s/backend-validation-formik-demo-v2-4fjbc

@ivankoleda Thank you for your examples, I was able to implement Formik with server-side validation. Just one minor thing tho, a little bit of inconsistency in the dirty variable.
At times with the error, the dirty variable will be set to true so that the user can reset the form, but other times it will not set it to true so the user has to reset the form one by one.
How do I fix this issue? Is there a workaround?
Thank you in advance.

@danielbyun dirty variable and Reset button hasn't been removed after forking default formik codesandbox they are redundant here. However it has no impact on validation. If I missed something please describe some real life case or create sandbox where described behavior creates some inconsistencies.

Is there any way to use this with formik-material-ui?

@dspacejs did find the solution for your use case ? i have a similar usecase my api call is decoupled like yours currently im using useEffect that watches for editErrorData ( backend form error fields )  thats updated in the redux state when i submit with empty fields
 const editErrorData = useSelector(state => state.referral.editErrorData);
    useEffect(()=>{
        if(editErrorData && formRef)
        {
            const { setFieldError, setErrors, setStatus, resetForm, values } = formRef.current;
            const errorFields = editErrorData.errorFields;
            resetForm({ ...values, status : { ...errorFields } })
        }
    },[editErrorData, formRef])

but setting it this way has an issue, when my fields are blank and when i hit submit, i get proper validation error shown at fields but my fields get repopulated with the initial value ( old data set in intialvalues of formik ) along with message and thats a problem any one have any solution for this ?

'Test'  is my initial value for first_name on the formik.

@chetanyakan
you can set status in submit handler like this
setStatus({ error: error._error, apiErrors: error.errors });
then use @ivankoleda code for error
const getError = (name, { touched, errors, status }) => {
  const fieldTouched = getIn(touched, name);
  const backendError = getIn(status, ["apiErrors", name]);
  const clientError = getIn(errors, name);

  if (clientError && fieldTouched) {
    return clientError;
  }

  if (backendError && !fieldTouched) {
    return backendError;
  }

  return undefined;
};

then you have two options:

Use a wrapper element for each formik-material-ui component and pass the error and helpertext depending on the result of getError
Do it only for some of the components. For example you only want to display the email in use error:

const emailError = getError("email", {
    touched,
    errors,
    status,
  });

and pass the email error to the component like this:
<Field
  type="email"
  name="email"
  component={TextField}
  label={"Email"}
  error={!!emailError}
  helperText={emailError}
/>


Error when server returns status of 404

When making a HEAD request with 404 status code the following error occurs with node v6.2.2 and node-fetch v1.5.3:
events.js:160
      throw er; // Unhandled 'error' event
      ^
Error: unexpected end of file
    at Zlib._handle.onerror (zlib.js:370:17)

... unless pass compress: false

Yeah, I think we ought to have a test case for where HEAD cause server to not send a body... as empty body is never valid gzip or deflate stream...

fixed in v1.6.0


Invalid target version should stop execution

Which version and edition of Flyway are you using?
If this is not the latest version, can you reproduce the issue with the latest one as well?
(Many bugs are fixed in newer releases and upgrading will often resolve the issue)
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Which database are you using (type & version)?
Which operating system are you using?
What did you do?
(Please include the content causing the issue, any relevant configuration settings, the SQL statement that failed (if relevant) and the command you ran.)
What did you expect to see?
What did you see instead?

Hi, I'm using flyway 5.2.4 version and when an invalid target version ( a version which is not in the Flyway source path) , the validation doesn't tells you that, rather it executes the callback statements and also the ignored patches( since the outoforder is set as TRUE) . Shouldn't the execution stop, if there is an invalid Input Target passed in the miigrate command.
Eg: flyway -url="my_database_url" -user='PROCESS_CICD' -password='my_db_password' -target='20.0602.201903041324' migrate  -locations=filesystem:/my_file_location -enterprise
The output says :
flyway-5.2.4]$ flyway -url="my_database_url" -user='PROCESS_CICD' -password='my_db_password' -target='20.0602.201903041324' migrate  -locations=filesystem:/my_file_location -enterprise
Flyway Enterprise Edition (trial) 5.2.4 by Boxfuse licensed to Dell until 2019-04-04
WARNING: You are using a 30 day limited Flyway trial license. After 30 days you must either upgrade to a full Flyway Enterprise Edition license or downgrade to Flyway Community Edition.
Database: jdbc:oracle:thin:@my_database_url (Oracle 12.1)
Successfully validated 7 migrations (execution time 00:00.193s)
Executing SQL callback: beforeMigrate
Current version of schema "PROCESS_CICD": 20.0502.201903041324
Schema "PROCESS_CICD" is up to date. No migration necessary.

This actually works as designed. I am however not opposed to leave this open for further enhancement in the future.

This is becoming an issue as if we try to give an invalid version , the validation doesn't identify that , as well as it deploys all the versions before the invalid version automatically. :(
Eg: if I have version 1,2,3 in the flyway patch and gives a version input as 2.1( which is an invalid version) , It deploys 1 and 2 and marks the database as Version 2. This issue needs to be addressed soon.

This feature is now available in the V7 beta which you can read more about here.


Chrome to force .dev domains to HTTPS via preloaded HSTS

Details at https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts/

There hasn't been a commit in almost three years.  Looks like the project is abandoned :(
By the way, the HSTS preload list is used by all major browsers.  This isn't specifically a Chrome thing, it's about increasing the security of the TLD.

I feel like we should also switch to using .test or .localhost instead of .dev. At least .test and .localhost are reserved and won't be sold to someone in the future.

It's already a configurable option, just a matter of updating the defaults (and documentation). In the meantime if you want to update it for yourself:
# ~/.powconfig

export POW_DOMAINS=dev,test

Then, per the code comments, reinstall for the resolver to pick up the updates
$ sudo /path/to/pow --install-system
$ touch ~/.pow/restart.txt

Switched from .dev to .test #547


Setup a Locals file for environment variables.

What does it do?
Performs build related changes to the repository and exports an object which is to be called for configuration using env variables.
Where should the file be located?
pmt-auth/src/config/

Hey Vaibhav, I want two methods. One, which will return env variables and two, which will add the env to the express object.


Fluent Bugging After Restart

I have Fluent and now after a restart it's bugged.
All I did was restart my computer!

Console:
3vendor~xpui.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'Translations')
at fluent.js:77
at i (vendor~xpui.js:1)
vendor~xpui.js:1 MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 change listeners added. Use emitter.setMaxListeners() to increase limit
at c (https://xpui.app.spotify.com/vendor~xpui.js:29:2621847)
at t.o.addListener (https://xpui.app.spotify.com/vendor~xpui.js:29:2624431)
at https://xpui.app.spotify.com/vendor~xpui.js:29:2254849
at Pa (https://xpui.app.spotify.com/vendor~xpui.js:29:2859649)
at Is (https://xpui.app.spotify.com/vendor~xpui.js:29:2883381)
at t.unstable_runWithPriority (https://xpui.app.spotify.com/vendor~xpui.js:29:3096964)
at gr (https://xpui.app.spotify.com/vendor~xpui.js:29:2829185)
at ks (https://xpui.app.spotify.com/vendor~xpui.js:29:2883160)
at Os (https://xpui.app.spotify.com/vendor~xpui.js:29:2868039)
at vs (https://xpui.app.spotify.com/vendor~xpui.js:29:2866961)
at https://xpui.app.spotify.com/vendor~xpui.js:29:2829457
at t.unstable_runWithPriority (https://xpui.app.spotify.com/vendor~xpui.js:29:3096964)
at gr (https://xpui.app.spotify.com/vendor~xpui.js:29:2829185)
at yr (https://xpui.app.spotify.com/vendor~xpui.js:29:2829402)
at vr (https://xpui.app.spotify.com/vendor~xpui.js:29:2829337)
at Ss (https://xpui.app.spotify.com/vendor~xpui.js:29:2867460)
at il (https://xpui.app.spotify.com/vendor~xpui.js:29:2893731)
at render (https://xpui.app.spotify.com/vendor~xpui.js:29:2896842)
at https://xpui.app.spotify.com/xpui.js:1:1042488
(anonymous) @ vendor~xpui.js:1
sentry.io/api/114855/envelope/?sentry_key=de32132fc06e4b28965ecf25332c3a25&sentry_version=7:1 Failed to load resource: the server responded with a status of 429 (Too Many Requests)
sentry.io/api/114855/store/?sentry_key=de32132fc06e4b28965ecf25332c3a25&sentry_version=7:1 Failed to load resource: the server responded with a status of 429 (Too Many Requests)
xpui.js:1 Uncaught (in promise) NotFoundError: GET request to sp://ads/v1/settings/leaderboard failed with status code 404
at d.onSuccess (xpui.js:1)
at onSuccess (xpui.js:1)
vendor~xpui.js:1 cosmos-connector:  fetchAdForSlot endpoint=%o sp://ads/v1/ads/hpto
pubads_impl_2021110901.js:10 [GPT] Invalid argument: PubAdsService.setRequestNonPersonalizedAds("0"). Valid values: 0,1.
(anonymous) @ pubads_impl_2021110901.js:10
pubads_impl_2021110901.js:10 [GPT] Invalid argument: PubadsService.setTagForUnderAgeOfConsent("0"). Valid values: 2,0,1.
(anonymous) @ pubads_impl_2021110901.js:10
VM35:9 Ads: HPTO HTML DFP Template: No iframe found for third party click tracking.
pubads_impl_2021110901.js:10 [GPT] Invalid argument: PubAdsService.setRequestNonPersonalizedAds("0"). Valid values: 0,1.
(anonymous) @ pubads_impl_2021110901.js:10
pubads_impl_2021110901.js:10 [GPT] Invalid argument: PubadsService.setTagForUnderAgeOfConsent("0"). Valid values: 2,0,1.
(anonymous) @ pubads_impl_2021110901.js:10
VM43:9 Ads: HPTO HTML DFP Template: No iframe found for third party click tracking.
banner:292 Pageview ok.
banner:300 View event ok.
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/vendor~xpui.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/xpui.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/696.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/xpui-desktop-routes-homepage-takeover-ad.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/xpui-desktop-modals.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/566.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED
DevTools failed to load source map: Could not load content for https://xpui.app.spotify.com/xpui-routes-home.js.map: Connection error: net::ERR_NAME_NOT_RESOLVED

Win 11
Fluent

if anybody needs anything ill be glad to add info

Your spicetify might be out of date. I had the same issue and running spicetify upgrade and spicetify restore backup apply fixed it for me.

Thanks it worked!


support string "1" and true boolValue & unify format & Dictionary initialize with switch pattern match

@watsonbox i just want to know, if the pr could be accept? i pull it before spring festival, and now i rebase code again.

@looseyi  Thanks for the pull request!  I've addressed the issue of "1" and "yes" 's boolValue in #887 and credit your name in pre-release note. Cheers!


await using hides potential unhandled promises.

Bug Report
See explanation below the code.
🔎 Search Terms
await using  disposable
🕗 Version & Regression Information
5.2 beta
💻 Code
(Symbol as any).dispose ??= Symbol("Symbol.dispose");
(Symbol as any).asyncDispose ??= Symbol("Symbol.asyncDispose");

import {promisify} from "util";
const delay = promisify(setTimeout);

class Resource {
  constructor(public readonly path: string) {}
  async [Symbol.asyncDispose]() {
    await delay(500);
    console.log('closed ' + this.path);
  }
}

class Boom extends Error {
  constructor() {
    super("Boom!");
  }
}

async function main() {
  await using file = await new Resource("thefile.txt");
  console.log(file.path);
  return Promise.reject(new Boom());
}

try {
  await main();
} catch (err) {
  console.log(`All good. Caught ${err.message}`);
}

🙁 Actual behavior
Boom [Error]: Boom!
    at main (file:///Users/luciano/git/ts-using/lib/index.mjs:70:31)
    at async file:///Users/luciano/git/ts-using/lib/index.mjs:83:5

The boom error is thrown due to being unhandled.
Explanation
My understanding is that this is happening due to return Promise.reject(new Boom()); returning a rejected promise, and the delay (with setTimeout) in the disposable function. The delay makes the rejected promise be seen and thrown.
It would be similar if the delay were in a finally section. However, the disposable function could be in an object within a library and thus not easily seen by users.
🙂 Expected behavior
thefile.txt
closed thefile.txt
All good. Caught Boom!

Caveat
The boom error should have been caught.
It could be that this isn't a bug, but working as expected. If so, let's consider making it clear in the documentation (e.g. use throw or return await Promise.reject()

Thanks to @tnymlr, who made me curious to try this after explaining how it fails on a finally block.

@lukiano: What script target are you using? If I run this sample code in the playground I get your expected result: Playground

I will note that if you use return Promise.reject(new Boom()) and your disposer throws a different error, then the new Boom() error will be lost, while awaiting or just simply throwing the error will result in a SuppressedError containing both errors (or an Error analog if SuppressedError is not shimmed).

This is my tsconfig.json
{
  "compilerOptions": {
    "outDir": "./lib",
    "target": "es2022",
    "lib": ["es2022", "esnext.disposable"],
    "module": "es2022",
    "moduleResolution": "node"
  },
  "include": ["./src"]
}

And my package.json for completeness
{
  "scripts": {
    "compile": "tsc",
    "start": "node lib/index.mjs"
  },
  "devDependencies": {
    "typescript": "^5.2.0-beta",
    "@types/node": "^20.4.2"
  }
}

Actually, I'm seeing the unhandled rejection in the console window, but less than a second later it disappears.

Ah, I see what you are getting at. Yes, this is the expected behavior because the rejection isn't awaited. You would see the same thing happen if you just used try..finally:
async function f() {
  try {
    return Promise.reject(new Boom());
  } finally {
    await null;
  }
}

This will also result in an unhandled rejection because the return value is still "unhandled" when the await in the finally block suspends execution. It isn't adopted by the Promise for the async function until all finally blocks are evaluated, including the implicit one created by await using. It's generally a bad practice to return a Promise in an async function since any rejections won't be caught in the body.

It's generally a bad practice to return a Promise in an async function

I agree. That said, coming back to my example:
async function main() {
  await using file = await new Resource("thefile.txt");
  console.log(file.path);
  return Promise.reject(new Boom());
}

For someone unfamiliar with using it's not apparent that there's an "implicit finally section". Hence my suggestion about documentation. I wonder what the tc39 group thinks about this.

I agree that this should be called out in documentation.


FullStop Command

Shutdown the PC and stop the bot as per @Fripe070 's request.


Prevent crash on Windows

This change was based on https://github.com/Yamakaky/joy/issues/13#issuecomment-1059251705.

Can you change that to assert_ge instead?

OK, done.

Ooh, my bad, I thought it was in std... In that case you can use assert!(nb_read >= report.len(), "{} < {}", nb_read, report.len()). Sorry!

In that case you can use assert!(nb_read >= report.len(), "{} < {}", nb_read, report.len()).

OK, done.

Nice, sorry for the confusion


Add Least Privilege Score Check to Policy MS.AAD.7.2v1

🗣 Description

This pull request modifies the AAD Rego code for policy MS.AAD.7.2 "Privileged users SHALL be provisioned with finer-grained roles instead of Global Administrator." by implementing a custom calculation for computing the tenant's least privilege check.  The least privilege score is calculated as the ratio of the number of users with Global Admin privileges to the number of users with other highly privileged roles. This change allows ScubaGear to automatically check for the least privilege score versus having the user manually check the Secure Score value for the action named Use least privileged administrative roles. This PR also includes Rego unit tests to check the logic in the Rego code.
Closes #760
🧪 Testing
I tested this against the G5 and E5 tenants which each had different scores. In addition, the unit tests check for the different pass and fail cases. To test this, run the ScubaGear tool against aad and check the report output for policy MS.AAD.7.2. To verify the result is correct, review the privileged_users array in the ProviderSettingsExport.json to count the number of users with Global Admin privileges and the number with other privileged roles but not Global Admin, and compute the ratio. This policy is dependent on MS.AAD.7.1 such that if MS.AAD.7.1 fails, MS.AAD.7.2 will automatically fail. This is because it is not meaningful to compute a least privilege score if the number of Global Admins exceeds the limit specified in the policy for MS.AAD.7.1,

✅ Pre-approval checklist

[x] This PR has an informative and human-readable title.
[x] PR targets the correct parent branch (e.g., main or release-name) for merge.
[x] Changes are limited to a single goal - eschew scope creep!
[x] Changes are sized such that they do not touch excessive number of files.
[x] All future TODOs are captured in issues, which are referenced in code comments.
[x] These code changes follow the ScubaGear content style guide.
[x] Related issues these changes resolve are linked preferably via closing keywords.
[x] All relevant type-of-change labels added.
[x] All relevant project fields are set.
[x] All relevant repo and/or project documentation updated to reflect these changes.
[x] Unit tests added/updated to cover PowerShell and Rego changes.
[x] Functional tests added/updated to cover PowerShell and Rego changes.
[x] All relevant functional tests passed.
[ ] All automated checks (e.g., linting, static analysis, unit/smoke tests) passed.

✅ Pre-merge checklist

[ ] PR passed smoke test check.

[ ] Feature branch has been rebased against changes from parent branch, as needed
Use Rebase branch button below or use this reference to rebase from the command line.

[ ] Resolved all merge conflicts on branch

[ ] Notified merge coordinator that PR is ready for merge via comment mention

✅ Post-merge checklist

[ ] Feature branch deleted after merge to clean up repository.
[ ] Verified that all checks pass on parent branch (e.g., main or release-name) after merge.

Test Results

Tested against G5, G3 and GCC high tenants to ensure that the score computes without errors - works fine
Tested compliant and non-compliant scenarios against the GCC high tenant - results below - works as expected

Tested compliant scenario where there are less Global Admins than non Global Admins - produces a Pass as expected and calculation value is correct based on the numbers in the tenant

Tested case where 7.1 fails because there are too many Global Admins so 7.2 should automatically fail as well - produces a Fail as expected

Tested case where the number of Global Admins is equivalent to the number of non Global Admins - produces a Pass as expected because the calculation = 1

Tested non-compliant scenario where there are more Global Admins than non Global Admins - produces a policy Fail as expected

Feedback on the Unit Tests

Missing a test scenario for the case when the # of Global Admins is greater than 8. This will trigger a Fail of policy 7.1 which should automatically fail policy 7.2 since it is dependent on it.

For test_SecureScore_Correct_V1 I'd like to see some variability in the usage of privileged roles referenced. Right now the test only uses Privileged Role Administrator for the non-global admin roles. Mix it up and usage a bunch of the other roles. The same applies to the other test scenarios for policy 7.2.

Missing functional test

Need functional test for policy 7.2

@nanda-katikaneni this PR is ready to merge.


Kubelet is unable to garbage collect on windows node.

Is this an ISSUE or FEATURE REQUEST? (choose one):
ISSUE
What version of acs-engine?:
Version: v0.14.5
GitCommit: 9c70bc1c
GitTreeState: clean

Orchestrator and version (e.g. Kubernetes, DC/OS, Swarm)
Kubernetes
What happened:
On windows node, Kubelet is not garbage collecting images even though the gc-threshold are set in the cluster spec.
    "apiVersion": "vlabs",
    "properties": {
      "orchestratorProfile": {
        "orchestratorType": "Kubernetes",
        "orchestratorRelease": "1.9",
        "kubernetesConfig": {
          "gcHighThreshold" : 60,
          "gcLowThreshold" : 40
        }
      },

Here are the error logs from kubelet on the node.
Logs for kubelet:
I0329 23:28:52.425805    2528 cri_stats_provider.go:210] Failed to get filesystem info: storageID is nil.
E0329 23:28:52.427806    2528 helpers.go:786] Could not find capacity information for resource memory
W0329 23:28:52.427806    2528 helpers.go:799] eviction manager: no observation found for eviction signal nodefs.inodesFree
W0329 23:28:52.427806    2528 helpers.go:799] eviction manager: no observation found for eviction signal imagefs.available
I0329 23:28:54.429864    2528 kubelet_node_status.go:497] Using Node Hostname from cloudprovider: "17516k8s9013"

Machine info:
Machine ID:
17516k8s9015
Kernel Version:
10.0.16299.248
OS Image:
Windows Server Datacenter
Container Runtime Version:
docker://17.6.2
Kubelet Version:
v1.9.3
Kube-Proxy Version:
v1.9.3
Operating system:
windows
Architecture:
amd64

What you expected to happen:
Kubelet should evict older docker images when the disk utilization goes above the gc-threshold
How to reproduce it (as minimally and precisely as possible):

Set gc-threshold to be very low in cluster spec.
Deploy one standard_d1_v2
Deploy pods with different windows containers

Expected:
Older images will be evicted.
Actual:
Disk fills up and you get the following error:
Failed to pull image "***": rpc error: code = Unknown desc = failed to register layer: re-exec error: exit status 1: output: time="2018-03-29T18:16:49Z" level=error msg="hcsshim::ImportLayer failed in Win32: There is not enough space on the disk. (0x70) layerId=\\\\?\\C:\\ProgramData\\docker\\windowsfilter\\bf4b94d3b31145ea22bd33039e62feaa491b4f57d1f02e79c4b0a30b84ec95a2 flavour=1 folder=C:\\Windows\\TEMP\\hcs428049779" hcsshim::ImportLayer failed in Win32: There is not enough space on the disk. (0x70) layerId=\\?\C:\ProgramData\docker\windowsfilter\bf4b94d3b31145ea22bd33039e62feaa491b4f57d1f02e79c4b0a30b84ec95a2 flavour=1 folder=C:\Windows\TEMP\hcs428049779

This is fixed in kubernetes v1.10


Fix lndmanage

The cd lndmanage caused an issue during my restore.. I assume the directory had not been reset from a previous script.

this happened to me in couple of scripts as I was tetsing and running the scripts with the admin user from the 00settingMenu.sh but the restore script is run with sudo.
Other way is to make sure it the bonus.lndmanage.sh is run everywhere with sudo -u admin.
Thanks for fixing!


Set initial_version to nil when git describe fails.

[x] Have you followed the guidelines in our Contributing document?
[x] Have you checked to ensure there aren't other open Pull Requests for the same change?
[x] Have you added an explanation of what your changes do and why you'd like us to include them?
[ ] Have you written new tests for your changes? Here's an example.

[x] Have you successfully run brew tests with your changes locally?

Fixes https://github.com/Homebrew/brew/issues/4652.

This PR would likely also fix https://github.com/Linuxbrew/brew/pull/779

Thanks, Markus!


Git was not found in your path

I'm getting the following error while trying to initialize a git repository from the cusp menu:

whereis: not enough arguments
Try 'whereis --help' for more information.
Git was not found in your Path

Even though:

whereis -b git
git: /usr/bin/git

Fixed that already. Kindly fetch the most recent version of cusp


Download button

Button to download the adjusted image

Button works, just needs to be made pretty

I made it pretty! (:


Template for soft delete.

Summary
Implement soft delete functionality.
You may use paranoia, discard or implement it yourself.

It would also be cool to give a choice to the user, I think

Only not the interactive one.


Bump suitcase-utils version

Based on the latest tag by @jklynch: https://pypi.org/project/suitcase-utils/0.5.0/#files.

Thanks, @danielballan!


MWPW-138927: desktop step 2 layout WIP

Desktop step 2 layout WIP with 3 cards.
Includes: https://git.corp.adobe.com/wcms/tacocat.js/pull/571
Resolves: MWPW-138927

@yesil could you add a test link, please?
Also lets merge this one once the Tacocat PR is approved and merged, otherwise there will be a code discrepancy


No module named 'mpglue.classification._moving_window'

I get an error message saying "No module named 'mpglue.classification._moving_window'" when I run "import mpglue import moving_window." I am running it on my Mac (MacOS High Sierra). Any advice you could give on solving this issue would be appreciated.

How did you install MpGlue? Did you build from source (below)?
python setup.py build && python setup.py install

Yes I did install mpglue. But it still returns an error: This is the entire error message I got:
import mpglue as gl
/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pysal/init.py:65: VisibleDeprecationWarning: PySAL's API will be changed on 2018-12-31. The last release made with this API is version 1.14.4. A preview of the next API version is provided in the pysal 2.0 prelease candidate. The API changes and a guide on how to change imports is provided at https://pysal.org/about
), VisibleDeprecationWarning)
Traceback (most recent call last):
File "", line 1, in
File "/Users/takaakimasaki/Dropbox/programming/python/mpglue/mpglue/init.py", line 3, in
from .classification.classification import classification, classification_r
File "/Users/takaakimasaki/Dropbox/programming/python/mpglue/mpglue/classification/classification.py", line 26, in
from ._moving_window import moving_window
ModuleNotFoundError: No module named 'mpglue.classification._moving_window'

The _moving_window module is a Cython module, so let's see if it compiled properly.

Do you see _moving_window.so under
/Users/takaakimasaki/Dropbox/programming/python/mpglue/mpglue/classification?
If no to (1), do you have Cython installed?
If yes to (2), do you see a list of .pyx files when running python setup.py build && python setup.py install?

Yes, I do see all those files. But still says "ModuleNotFoundError: No module named 'mpglue.classification._moving_window'"... Not sure what's driving this error.

Can you uninstall mpglue, rebuild and install and post the tail of the traceback?

Hi, I've the same error when I import mpglue from python shell
This is my complete trace:

Build and Install
https://paste.ofcode.org/r5DYguwXtxU8kRffza3ZaL

pip install
https://paste.ofcode.org/YmXu7xVdcfms7MJHF79GYx

import
https://paste.ofcode.org/EyvF7GA9g8FTz3f7hLx2VZ

Thanks, so much!

Also, this is the classification's dir content
https://paste.ofcode.org/ZnbEvHTZbq8YtY7F25VdG

Solved!
Was my fault unzip mpglue folder at the same point to access the python shell,

import mpglue
the .so files were compiled into virtual envoiroment path

Also, I must to install 2 pypi extra, Fiona and shapely

@takaakimasaki where are you importing mpglue from on your terminal? See below if you are attempting to import from within your mpglue Git directory.
Looking at the traceback of @vdeluca I can see that the installation was clean. However, in the (3. import) test you were inside the mpglue Git directory that you pulled. If you pip install then the package is installed into your environment /site-packages directory. The mpglue Git directory doesn't have any .pyx extensions compiled. Therefore, if you try to import mpglue from within the Git directory, Python will first attempt to import the relative package, when the correct installed package is in your /site-packages.
You can check where you environment /site-packages directory is located by importing another package, like "python -c "import numpy as np;print(np.file)".
To test the installation of mpglue, cd somewhere like your home directory so that Python cannot see the Git directory.

Here is an example of what I was referring to in the previous comment.
> git clone https://github.com/jgrss/mpglue/
> cd mpglue/
> # activate a virtual environment if you have one
> python setup.py build && pip install --upgrade --user .
> cd ~
> python -c "import mpglue"

Also, this is the classification's dir content
https://paste.ofcode.org/ZnbEvHTZbq8YtY7F25VdG

@vdeluca The above link should be related to the same issue. The import fails because you are missing the compiled files (.so files) inside the Git directory. If you check the mpglue /site-packages directory after installation, you should see the .so files.


READINGS: Add Introduction to the Theory of Computation book (Michael Sipser)

This book contains an easy to understand introduction to the automata theory, which is missing in "Introduction to computing" book by David Evans. It does not require complicated math, so it can be useful to students who do not want to become theoretical computer scientists but want to have a general understanding of its topics. Also, it almost perfectly matches the Automata Theory course we have in the curriculum.

This book is on my own personal reading list but it somehow wasn't on the curriculum. Thanks!


Add option to set the window title with the serial number

I have multiple devices with the same model name.  Setting this window title with a different name is really useful.
Fixes #120

Thank you for your contribution.
I agree to add we could add an option to set the title. However, I think that the behavior of --window-serial is too specific.
I suggest a more general option `--window-title'. A first version could just receive a "constant" window title:
scrcpy --window-title "My device"

An improved version could also support "variables" dynamically retrieved from the device:
scrcpy --window-title "My Device - %m [%s]"

which would set the title My Device - Nexus 5 [0123456789abcdef].
Note that there are two possible serial values: the one provided by the user with -s, and the real one retrieved from the device:
provided              real
--------              ----
""                    "0123456789abcdef"
"0123456789abcdef"    "0123456789abcdef"
"<IP_ADDRESS>:5555"   "0123456789abcdef"

I think it is better to expose the real serial then the provided one:

it works even if the user does not provide a serial (when there is only one device);
the provided one is known by the caller (it is passed to -s), so the value might also be passed to --window-title.

What do you think?
As a side node, I would like to expose only a long option --window-title without a short version (-w) for advanced options, to keep the letters available for future features. If I had implemented them now, I would not have added a short version for options like --always-on-top and --show-touches…

I like to keep the title short and sweet.  Long titles just are just cropped out of some characters.
However, I agree with all of your points.

I agree with all of your points.

Do you plan to update this PR to implement --window-title? or someone else can work on this?

real serial is not a trivial change.  I'll rather stick with what I have
and removing the short switch.
On Fri., Jun. 7, 2019, 11:50 a.m. Romain Vimont<EMAIL_ADDRESS>wrote:

I agree with all of your points.
Do you plan to update this PR to implement --window-title? or someone
else can work on this?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Genymobile/scrcpy/pull/573?email_source=notifications&email_token=AFZMFPKZRBZJS7JTHWAYNA3PZJ7UFA5CNFSM4HSVELJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXGHJWY#issuecomment-499938523,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AFZMFPPCUDSUKXQNP2DIEDTPZJ7UFANCNFSM4HSVELJA
.

real serial is not a trivial change.

As a first step, an option --window-title accepting a constant string would probably be sufficient.
Then you could call:
scrcpy -s<PHONE_NUMBER>abcdef --window-title<PHONE_NUMBER>abcdef

What do you think?

leave me to it

closing this... sending another pull request


Which T5 model was used for fine-tuning?

Hi,
could you kindly tell which T5 model (T5-small, T5-base, T5-large, T5-3B, ....) the Parrot Project is based on?
Kind regards

It seems to be the T5-base model because the model from Parrot has the same size (pytorch-model.bin 850 MB) as the T5-base model.
Sources:
Parrot Model: https://huggingface.co/prithivida/parrot_paraphraser_on_T5/tree/main
T5-base: https://huggingface.co/t5-base/tree/main


Add a README.md

Additionally I'd like to have a github.io page looking like lodash documentation

see #12 for the documentation

It would be nice to highlight that :

immutadot is mainly designed as a helper lib for redux
immutadot is largely based on lodash and lodash/fp

Also add simple examples with an es6 version and an immutadot version of the code

In addition of the README, add a code of conduct and contributor guidelines.
See https://github.com/Zenika/immutadot/community


Implement paged block writer

What changes are proposed in this pull request?
Implement paged block writer
Why are the changes needed?
Implement paged block writer for paged block store
Does this PR introduce any user facing changes?
no

alluxio-bot, merge this please.


Picking input prop(s)

For changing the prop of an input from the default value, right now we have eg:
dcc.DatePickerSingle().props["date"]
dcc.DatePickerRange().props[("start_date", "end_date")]

The great thing about this syntax vs dcc.DatePickerSingle().date is you can easily pick multiple values and pack them into either a list or a dict for your function - and we should allow you to do either of those with the regular id/prop callback definitions too (though list packing would probably have to be a breaking change due to how we unlisted outputs, inputs, and state in dash 1.x)
I don't get why it's formatted to look like a dict though - to me it's more like a method modifying the component's "value" to be some prop(s) other than value.
Also: what if you want one prop as input and another as state? For example a dcc.Store with data as state, modified_timestamp as input? And per #5, what if you want modified_timestamp to be a Trigger, or hidden? We could imagine making tuples:
dcc.Store().props(("modified_timestamp", "state"), "data")
or take advantage of the fact that props can't have dots in them:
dcc.Store().props("modified_timestamp.hidden", "data")

no longer applicable to current design


Added Global getter/setters

Reworked worldGetAll/Nearby Methods
Added back World.GetNearbyPeds(Ped, radius);
Added Helper class
Tweaks to Raycast
Added GetCrosshairCoordinates

#259 #252 Fixed in this commit
Also changed added 1 to max length parameter when showing keyboard to account for the string terminator character('\0')

#283 Fixed in this commit by incrimenting the max length on the actual native call instead of functions that call it
#223 Added Global access

I only get the player when trying to use GetAllEntities().

When i tested they all worked perfectly

GetAllEntites Works fine for me - http://puu.sh/jQhEt/b3e14c6de3.png
What game version are you running

The latest one.

steam or warehouse

Steam.

Hmm Looks like Im gonna need a 1.0.393.4 steam exe to check this out. it seemed to work fine on older steam game versions. Can you show me the code you are using

I am just simply setting the value to a List by using Linq, and then I'm retrieving them by using a menu API.

There's certainly nothing wrong with my code.

make sure you are using this build of the hook - https://ci.appveyor.com/project/crosire/scripthookvdotnet/build/Build No. 432/artifacts
Put this in a cs file in your scripts folder and start gta, if you see loads of yellow flashing markers, the problems your code. If you dont then the issue is the steam exe failing a signature somewhere

I can only see the player, still.

Huh the signatures are all correct, I have no idea why it isnt working for you

Apparently, when I come close to vehicles, they also get marked, but that's it.

The script only marks entities within 20m of you
looks kind of like this, the things in the garage are about as far as it will draw the markers

It doesn't draw props or peds on my side, though.

are you using ragepluginhook, someone just tested on the steam version and got this result
http://puu.sh/jQxcw.jpg

No, I'm not.

Apparently, the peds get marked when I punch them.

Are you updated to the latest version of scrupthookv other than that i cant think of any issues

Let me check.

@Nacorpio any idea what was causing the issue

Still the same issue.

Working fine here too, latest steam version.

@Nacorpio Did you double-check everything? :P


[[FIX]] Avoid crash when peeking past end of prog

The lexer returns null values when tokens are requested after all
input has been consumed. Previously, the peek function would correctly
produce the special "(end)" token in situations where the parser
attempted to look beyond the end of the program. In such cases, however,
it would also pollute the lookahead buffer with an invalid entry--the
null value returned by the lexer. Future calls to peek could receive
this buffered value.
Because JSHint's internals are written with the assumption that peek
always returns a token object, the null value would trigger a
TypeError and subsequent program crash.
Re-factor the peek function to only insert valid token objects into
the lookahead buffer.

This ought to resolve gh-2932.
@rwaldron and/or @caitp: would you mind merging this if it looks good to you?

Coverage increased (+0.02%) to 97.674% when pulling cfe3e412fd3a178bdc691fa53c4d904e642d8371 on jugglinmike:2932-peek-exhausted into 78cf7c1ecccc22ad4e31beae015c54b16722e407 on jshint:master.


Are there standards for connecting to third party providers

Right now, Hydra allows to connect to different providers by supplying a provider param to the authorize url: hydra/oauth2/auth?provider=dropbox&cliend_id=123&...
At this point in time, only Dropbox and Login are shipped but this is going to change with #33 . The Login provider acts as a fallback and basically redirects the user to a url and expects that endpoint to redirect the user back to hydra, providing a "login token" (you might already see the unintentional similarity to OpenID Connector) which the Login provider then validates and exchanges for an authorize code.
I have seen a similar approach at Auth0.com but I would really like to find a spec for this and implement it instead of shipping my own solution.
So here's the question: Is there a standard way to specify a (thirdparty) ID provider like Dropbox, Google or some other IdP? I would appreciate any help :)

As far as I can tell there are none. However, providers will be renamed to connectors, as this seems to be the wording people have agreed upon.

Superseded by #38


CurrXmlPort vs. currXmlPort False Positives

Hi @StefanMaron,
It appears that with the new release LC0005 can't decide if it wants to have currXMLPort or CurrXmlPort. Could you resolve this? Perhaps accept both while we are at it? 😊 (simply because CurrXmlPort looks better, more consistent 😇)

Nevermind. Only appears to happen when using the 9.0 preview AL Language for some reason. 🤔


#113 Spilling list storage

Resolves #113

a note for myself: once merged, don't forget to update the configuration page in the wiki

Once again thanks for your review, guys. I just made some updates hopefully fixing all of the previous troubles.


Fix string conversion when ignore contains double quote (binary strin…

…g value)
ex for this string : unique:invitation,email,"ÔËŸ\x12êŒD\x08„gu|:Gl"",uuid
where $id  = ÔËŸ\x12êŒD\x08„gu|:Gl"
Rule::unique('invitation', 'email')->ignore($id,  'uuid');

if $id is binary string that contains double quote, the string conversion is not wroking well.
i think for security issue, a base64 encoding can be better on parameters

Not working on any case


spectral simulation validation notebook

In order to validate the spectral simulation, we need to compare the redshift success rates predicted by them to redshift success rates from actual observations. I already have a pipeline for doing this but it's scattered across different scripts.
Construct a single jupyter notebook that can take the observing conditions of a DESI BGS exposure (exposure time, sky brightness, etc) and

construct spectral simulations with realistic signal-to-noise
run redrock on the spectral simulations and calculate redshift success rates

implemented a jupyter notebook for validating BGS spectral simulations


Cannot add to a Team/Channel

When attempting to add the app to a Team via the app we are met with a white screen and the save button is unavailable. I believe this is due to the manifest, could you please direct me where to go to ensure the configurable tab is setup properly?

Same issue, the only way I can add the app to a team is through powershell, opening the app works in teams I have the command against. If you try to add it to a new team or open it without adding it via powershell we are met with the screenshot I provided.

Hi @clarkec2,
Sorry but i am little confused. Is the app working as expected without adding it to any Teams when directly opened from "Apps" section.
Thanks.

Yes the app works perfectly fine "on its own".  Again, when you try to add it to a Team that white space page pops up and you cant "save" it.

Hi @clarkec2,
The app is mainly designed to act as stand alone app. We are also adding this app as a tab in the General channel of the Incident Teams created dynamically. But this will open the Active Bridge of the incident which opened from within incident teams.
So now that you have mentioned you were able to add the app to a Teams through power shell what do you see in the tab. Can you please share a screenshot.
Thanks.

This what is shown when adding it to channel for pinning...

After clicking the pin to team button...

From the documentation...

Which isnt working.

Hi @clarkec2,
Sorry if iam getting it wrong but in one of your previous messages you mentioned its working fine when added through power shell. Can you please share a screenshot of the app working when added as tab in channel.
Thanks.

I literally just did that, see the previous screenshots. This app is used by non techs without admin access and needs to be added as a tab to channels and teams at their discretion, they dont have access to powershell to add and remove the app as needed. Your documentation states that the app can be "added as a tab" which in our env currently it cannot, looking over this it appears to be from the manifest settings around that configurable tab.
Again....

Read the issue and stop trying to interpret what you feel I am trying to say. The app cannot be added as a tab to a team/channel, we are met with the previous screen shots where it wont allow us to save.

Hi @clarkec2,
We have identified the issue and working on a fix. We will try to release the fix ASAP.
Thanks.

Hi @clarkec2,
We have released a hot fix for the fix. You should now be able to add the app as a tab to a channel. Please upgrade your app as per the upgrade instructions in the Wiki depending on your current version.
Thanks for your feedback. I am closing this ticket for now. Please feel free to re open the ticket in case of any issues.
Thanks.


Admin UI Tweaks

Just a few tweaks to the Admin UI, some minor styling fixes I've been playing with and a couple of bugs squashed:

Generally increased font sizes slightly on the list screen
Dim out the navigation items until you move your cursor over the nav (emphasises the selected item a bit more)
Fix the checkbox for "select all" when no items are returned (would previously be checked)
Actually displays the selected item value when you're filtering by relationship fields

@jossmac over to you to make sure you're happy with this

Do you mind adding some before/after screenshots or links?

@jesstelford
New colours and sizes (mouse not over nav)

The nav goes back to its current scheme when you put the cursor over it:

Previous font sizes and spacing:

It's pretty subtle; the tweaks just make it feel slightly less cramped imo


Extending packets by re-encoding the same data

In some cases an existing packet design needs to remain in place but we also want to update the encoding for a field in the packet. Ideally the packet layout would be augmented to reference the same in-memory field later in the packet. Currently protogen will not allow that, because it will think of the two encodings as separate in memory data, even though they have the same name. We can fix this by checking the name of a field against previous fields, and if it is the same either issue a warning (or based on some other flag) just silently update the encoding.

See inMemoryType="override". 1.9.6


Locking fails when uploading without an architecture type

Steps to reproduce:

Add a sleep(60) here: https://github.com/krobertson/deb-s3/blob/master/lib/deb/s3/cli.rb#L233
Run deb-s3 upload -l -p -b your-bucket -v private your-package.deb
While it's sleeping in your-bucket/dists/stable/main you'll discover a binary- folder holding the lockfile

The fix should be as simple as getting a list of all arch types up front, but this is complicated. Reasons:

A user can specify an arch type, this over rides the arch type on the package. https://github.com/krobertson/deb-s3/issues/95
Manifests with no packages to upload, are still being uploaded. https://github.com/krobertson/deb-s3/issues/96

@alexmreis

And by simple, I mean, getting a list of all arch types, getting a lock on each, storing that an array, and looping to unlock.

An additional issue, by using the same lockfile name, you'll still have issues, as I discovered testing another issue:
https://aws.amazon.com/s3/faqs/
Q: What data consistency model does Amazon S3 employ?

Amazon S3 buckets in all Regions provide read-after-write consistency for PUTS of new objects and eventual consistency for overwrite PUTS and DELETES.

I'd suggest the fix would actually be requiring the architecture to be explicitly specified if -l is used and exiting with an error if it isn't. Having multiple locks increases the complexity of something that is already fragile. That said if you consistently don't specify the architecture, then the behaviour of the locking mechanism is still consistent, albeit a bit dirty to the repo layout.
The eventual consistency for removal of the lock doesn't matter much, as it would only be potentially dangerous to actually go ahead and write things to the repository while someone else is also doing it. There is a built-in polling wait mechanism in -l that retries to acquire a lock for some time before giving up.
The -l option always checks for an existing lock first, and if and only if a lock is not found does it try to write a new lockfile, so a replace wouldn't ever occur. Read-after-write consistency is good enough for the purposes of at least adding packages. I strongly advise against deleting any without revoking permissions to the bucket to all other users first.
Could you please elaborate on the issue you have uncovered regarding the eventual consistency @jjshoe ?

@alexmreis I deleted the eventual consistency comment from here, I'll make a new issue when I come up with a great way to reproduce.

@alexmreis also, see https://github.com/krobertson/deb-s3/issues/95.

@alexmreis - Actually, I have the nail in the coffin, and the safest possible way for you to do this anyway. You should lock at the bucket level. I know, then it's not as fast as it could be, but bucket-name/dists/stable/Release gets updated every run as well.

Also worth noting, specifying an architecture type out front makes it difficult to upload a whole mess of deb files of different arch types.

A bucket level lock breaks the idea of multiple repositories in the same bucket that the --prefix option allows for. It should at least be on the prefix level, but I do like the idea @jjshoe

@alexmreis yes, sorry, I'm all for prefix, replace bucket with repository.


PermissionError: [Errno 13] Permission denied: 'C:\Users\yotam\AppData\Local\Temp\tmpfk7tmhv0.json'

the example doesnt seem to work
import uvicorn
from fastapi import FastAPI
from profyle.fastapi import ProfyleMiddleware

app = FastAPI()
# Trace all requests that match that start with /users
# with a minimum duration of 100ms and a maximum stack depth of 20
app.add_middleware(
    ProfyleMiddleware,
    pattern="/users*",

)

@app.get("/users/{user_id}")
async def get_user(user_id: int):
    return {"hello": "user"}

uvicorn.run(app, host="<IP_ADDRESS>", port=8080)

i get the error mentioned in the title. your library seems really cool and i would really like to use it

Thanks for reporting, I will take a look to this issue. Can you provide the entire error trace? Also I need more info about your operating system.

INFO:     Started server process [21668]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://<IP_ADDRESS>:8080 (Press CTRL+C to quit)
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 399, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 186, in __call__
    raise exc
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\profyle\infrastructure\middleware\fastapi.py", line 37, in __call__
    with profyle(
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\profyle\application\profyle.py", line 46, in __exit__
    self.tracer.save(temp_file.name)
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\viztracer\viztracer.py", line 235, in save
    rb.save(output_file=output_file, file_info=file_info)
  File "C:\Users\yotam\AppData\Local\Programs\Python\Python310\lib\site-packages\viztracer\report_builder.py", line 186, in save
    with open(output_file, "w", encoding="utf-8") as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\yotam\\AppData\\Local\\Temp\\tmp8i7s87zd.json'

This is due to windows permissions, simply setting delete=False on the NamedTemporaryFile fixes it:
https://github.com/vpcarlos/profyle/blob/main/profyle/application/profyle.py#L45


chore: run eslint with type information on CI

Summary
We OOM if we run the entire lint run with type info (see https://typescript-eslint.io/docs/linting/typed-linting/monorepos/#important-note-regarding-large--10-multi-package-monorepos), so I've added a script.
We have a toooooon of errors, so I just fixed a few of them. Should chip away at this when people have time 🙂
This is somewhat annoying as IDE integrations etc won't apply, but better than nothing

Test plan
Added CI run

Current state running against all packages btw: ✖ 2979 problems (2979 errors, 0 warnings)


Stack: replicas and public.name required?

Sample stacks failing.  sample05 failing because public.name and replicas not set in stack file.  If these are required a user friendly error should be returned in both cases (as of now it is hard to tell what is wrong).  If defaulted I assume replicas is 1 and public.name is the name of the service.

Replicat issue fiixed in PR#270

fixed close issue


ISPN-15639 Upgrade JGroups to 5.3.2.Final

https://issues.redhat.com/browse/ISPN-15639

supersedes https://github.com/infinispan/infinispan/pull/11911

CI failed again

Looks like it died due to Hot Rod Client GraalVM.. guessing it is because of OOM again :(


[WIP] Update mock-chunk to use last-chunk-snark copy (release v0.5.2)

Used for release v0.5.2.
TODO

[x] small fix to verify EVM calldata directly, merged from https://github.com/scroll-tech/scroll-prover/pull/196.
[ ] update Cargo.toml to use zkevm-circuits develop branch after merging the zkevm-circuits PR, then run aggregation-tests again.

Aggregation-tests could pass with the current code.


feature request - permission node for guild chat ChatColor usage

I notice Guilds auto translate '&' to chat color
Maybe we need a permission node like guilds.command.chatcolor to control it

Have you tested this with a user who does and doesn't have essentials.chat.color?

I have a '-essentials.chat.color' node

Okay, I can look into adding a permission node for this.
If you want to just disable color codes in general, you can remove the & in the regex in the config.

Added when you toggle /guild chat


Fix/33976: Workspace name in request flow is wrong color and navigating back

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/33976
PROPOSAL: https://github.com/Expensify/App/issues/33976#issuecomment-1877719712
Tests

Create a workspace if none was created.
Request money and if not selected select a workspace as the participant.
Visual verify the workspace's avatar is not dimmed and visible.
Click on the workspace's avatar and confirm the app navigate to the workspace details page.
Click on the back button.
Verify the app navigated back appropriately and verify no visual abnormalities on the page
Repeat steps 6 and 7 until before the start of the money request in step 2 to verify the back button works.

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

Offline tests

Create a workspace if none was created.
Request money and if not selected select a workspace as the participant.
Visual verify the workspace's avatar is not dimmed and visible.
Click on the workspace's avatar and confirm the app navigate to the workspace details page.
Click on the back button.
Verify the app navigated back appropriately and verify no visual abnormalities on the page
Repeat steps 6 and 7 until before the start of the money request in step 2 to verify the back button works.

QA Steps

Create a workspace if none was created.
Request money and if not selected select a workspace as the participant.
Visual verify the workspace's avatar is not dimmed and visible.
Click on the workspace's avatar and confirm the app navigate to the workspace details page.
Click on the back button.
Verify the app navigated back appropriately and verify no visual abnormalities on the page
Repeat steps 6 and 7 until before the start of the money request in step 2 to verify the back button works.

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

PR Author Checklist

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

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

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

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

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

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

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

[x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
[x] I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
[x] I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
[x] I verified the JSDocs style guidelines (in STYLE.md) were followed

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

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

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

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

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

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

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

Screenshots/Videos

Android: Native

https://github.com/Expensify/App/assets/22982173/4d6b4be2-2121-4e33-9011-578d25de6592

Android: mWeb Chrome

https://github.com/Expensify/App/assets/22982173/b96c3dac-7b94-4e0d-988a-4eca93e02ee4

iOS: Native

https://github.com/Expensify/App/assets/22982173/8f2105ef-5fb2-4288-ad46-c303b573728c

iOS: mWeb Safari

https://github.com/Expensify/App/assets/22982173/87f80330-41a6-40ab-8bac-a474dafad8c1

MacOS: Chrome / Safari

https://github.com/Expensify/App/assets/22982173/f4dda757-66f9-4354-b087-ec5b17e40020

MacOS: Desktop

https://github.com/Expensify/App/assets/22982173/41bb8a2b-9506-4a8c-b200-66f14a456fb0

@ntdiary do you think you can review this today or tomorrow? Thanks!

@dangrous @ntdiary is OOO this week. I can take over. Otherwise wait until next week

🚀 Deployed to staging by https://github.com/dangrous in version: 1.4.42-0 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅

🚀 Deployed to production by https://github.com/chiragsalian in version: 1.4.42-5 🚀

platform
result

🤖 android 🤖
success ✅

🖥 desktop 🖥
success ✅

🍎 iOS 🍎
success ✅

🕸 web 🕸
success ✅


Edited summary

Edited summary: added a description of the SPSite object.

Docs Build status updates of commit a74249f:
:clock10: Full build: the average full build time is 61 min(s) 27 sec(s), this is based on the last 4 build(s) for this repository.
:warning: This is a FULL build due to a recent Docs Build service upgrade, normally no action is required on your part. In the result you find subsequent builds still performing full builds, please contact your repository admin to manually perform a full build on the 'live' branch. For more detailed info, please click here.

Docs Build status updates of commit a74249f:
:white_check_mark: Validation status: passed

File
Status
Preview URL
Details

sharepoint-server/xml/Microsoft.SharePoint/SPSite.xml
:white_check_mark:Succeeded

For more details, please refer to the build report.
Note: If you changed an existing file name or deleted a file, broken links in other files to the deleted or renamed file are listed only in the full build report.


"unexpected resource" error logged when changing js file type

Issue Type: Bug
repo

Open a js file
Now change the file type to json
Trigger suggest in file

Bug
In dev console, see unexpected resource errors being printed. This is does not actually seem to cause any problems, it just alerts us that something unexpected is happening
VS Code version: Code - Insiders 1.31.0-insider (9606490e26f8cbe4d615305389d45e9b144ded7c, 2019-01-30T15:15:08.172Z)
OS version: Darwin x64 18.2.0

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz (8 x 2200)

GPU Status
2d_canvas: enabledchecker_imaging: disabled_offflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onnative_gpu_memory_buffers: enabledrasterization: enabledsurface_synchronization: enabled_onvideo_decode: enabledwebgl: enabledwebgl2: enabled

Load (avg)
3, 3, 3

Memory (System)
16.00GB (0.18GB free)

Process Argv
-psn_0_20636589

Screen Reader
no

VM
22%

Moved out since this does not actually cause any user facing problems.
I suspect the error @jrieken saw comes from some race in the folding provider. I saw that once in my testing but hadn't been able to reproduce it again. Will investigate for February

Should be fixed by de66301ff28981d75a9dbc8aa201f52fdc711d04


Limit on number of mqtt connects per VM

Hello,
I have been working with locust mqtt script for last couple  of days. I am not able to connect more than 334 mqtt locusts per VM in any way. I am using the following configurations
BROKER: AWS IoT broker
VM: AWS EC2 t2.xlarge
The VM has everything maxed out including number of open file descriptors, virtual memory etc.
Even if I start with 400, 500 or any number of locusts more than 334, They are hatched successfully according to logs, but the number of CONNECTs requests never exceeds 334.
Any idea about this issue? I will provide logs and other configuration details if required.

I don't think this is related to Locust, but it's more likely related to AWS IoT and some restriction related to the number of connections from a single client. In HTTP tests I've been able to create thousands of users in a single load generator, the only limit being the EC2 instance size and the number of open files (defined in /etc/security/limits.com), but it seems you already tried with those options and your EC2 instance size should be more than enough.
I experienced a similar problem and was able to overcome the issue by launching a distributed Locust test (multiple slave load generators).  To save cost, I think each slave could run in a t2.medium. Here is a link to the Locust documentation on how to run distributed tests: https://docs.locust.io/en/latest/running-locust-distributed.html
Unfortunately, there's no clear limit that explains this behaviour in the AWS IoT Service Limits page: https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html

Taking a closer look at this issue, it is more likely to be related to this MQTT Paho issue: https://github.com/eclipse/paho.mqtt.python/issues/238 rather than an AWS IoT service limit.
As mentioned in the previous comment, one workaround is to launch distributed tests, where a single load generator doesn't hatch more than 340 users (which could likely be done with a t2.micro per slave - probably no need to launch a t2.medium as suggested in the previous comment) . However, this approach becomes impractical for tests with a large number of users (i.e. > 10K, >100K)
I'll keep this issue open and use it to keep track of a solution that simplifies the process of launching many load generators, likely through the use of containers or a similar solution.

I'm hitting the same issue with MQTT/Paho adopting your sample, this time against Azure IoT so definitely is not IoT causing it. Showing only 337 connected though Locust says 500 was spawned.
Any update on a solution to get around this?

We have in our backlog adding support for automating the launch of Docker containers in ECS, which we think will solve the problem. However, we don't have it in place yet.


[Fix #5656] Prevent def_node_search methods from throwing unexpected errors.

This addresses issues described in #5656 where methods generated by def_node_search might throw errors.
I would get various TypeError or NoMethodError when attempting to run def_node_search methods. They would manifest differently depending on match pattern and source code inspected. In the clearest repo case I could create I had a search for a pattern that did not exist in the examined source code. I was expecting that to not throw any errors.
After stepping through in the debugger and inspecting the body of the generated methods I narrowed the errors I was seeing to compile_literal:
https://github.com/bbatsov/rubocop/blob/1df6f7d29a9f5084a187a1ffa01af77fcd874db0/lib/rubocop/node_pattern.rb#L351-L353
This code generates something like this:
(temp4.type == :const)

The problem is that when using def_node_search the node being inspected (in this case temp4) might not be of Node type.
This PR is an attempt to address that by adding an extra check before calling .type on the node. I'm open to alternative solutions, but this is the best I could work out.
All RuboCop tests continued to pass after this change.
I attempted to add a test for this change, though I could not find any existing pattern to test def_node_search.

Hmm... looks like I didn't format the changelog entries correctly. I'll get that fixed.

I don't agree this change.
The pattern ((:lvasgn ... (:send (:const nil? :Foo) :new _ _))) is invalid. We cannot use ... for lvasgn node. We should use _ instead.
For example:
(:lvasgn _ (:send (:const nil? :Foo) :new _ _))

Why invalid
lvasgn node has two forms. (lvasgn :a (int 1)) (a=1) and (lvasgn :a) (in a+=1).
$ ruby-parse -e 'a=1'
(lvasgn :a
  (int 1))

$ ruby-parse -e 'a+=1'
(op-asgn
  (lvasgn :a) :+
  (int 1))

(lvasgn ... (send ...)) is invalid for the second form.
(lvasgn     :a        ) # Node
(lvasgn ... (send ...)) # Pattern
        ^^^ `...` matches nothing.
            ^^^^^^^^^^ `(send ...)` matches `:a`, but the pattern expects a node, so it raises an error.

This pull-request can prevent the error, however I think it will conceal bugs. It silently fails, so I guess we cannot notice a bug if we write an invalid pattern.
So I think we should fix the pattern if we see the error.

By the way, I think the compiler should add a compile error to the code, but I'm not sure it is easy or not.

Thanks for looking at this PR and your feedback.
The example I provided in the spec is a little simplified from that I actually was trying to do. I am trying to detect a new instance of a class including whatever it's assigned to, be it a normal variable, instance/class variable or constant.
var = Foo.new
$var = Foo.new
@var = Foo.new
@@var = Foo.new
VAR = Foo.new

So my original pattern was something like this:
({:lvasgn :ivasgn :cvasgn :gvasgn :casgn} ... (:send (:const nil? :Foo) :new _ _))

This is somewhat similar to what you see in node.rb for detecting assignment:
      def_node_matcher :equals_asgn?, <<-PATTERN
        {lvasgn ivasgn cvasgn gvasgn casgn masgn}
      PATTERN

      def_node_matcher :shorthand_asgn?, '{op_asgn or_asgn and_asgn}'

      def_node_matcher :assignment?, <<-PATTERN
        {equals_asgn? shorthand_asgn? asgn_method_call?}
      PATTERN

Though I tried to use this in a large pattern. If I use a _ instead of ... it will not match constant assignments.
That being said, even if we ignore constant assignments and focus on lvasgn then the pattern with _ also throws errors:
(:lvasgn _ (:send (:const nil? :Foo) :new _ _))

NoMethodError: undefined method `type' for nil:NilClass
C:3:in `block in example_match'

So I'm then wondering, is there a way with the current pattern matching to capture any of assignment types without running into errors?
var = Foo.new
$var = Foo.new
@var = Foo.new
@@var = Foo.new
VAR = Foo.new

Follow up question to why ... is invalid, I had thought that _ meant "any single nodeand...` meant "any number of nodes" (kind of like Ruby's splat operator). Is that not the case then?
You also mention; "but the pattern expects a node, so it raises an error.` - this also confuses me. If the pattern expects a node that isn't there - why doesn't that count as a non-match? Why is that treated as a throwing error?

By the way, I think the compiler should add a compile error to the code, but I'm not sure it is easy or not.
Agree, having more compiler errors for invalid patterns would help. The patterns can be a challenge to write. I've been looking at the RuboCop patterns and the source code to try to work out how the syntax work. It seemed worth learning how they worked instead of attempting to match node by manually traversing..

I thought at first it was def_node_search that was causing problems, but it appear that def_node_matcher also run into unexpected problems.
For instance, given this spec:
    it 'does not register an offense for SketchupExtension in root file' do
      inspect_source(['extension = SketchupExtension.new("Extension Name", filename)',
                      'Sketchup.register_extension(extension, true)'],
                      './src/hello.rb')
      expect(cop.offenses).to be_empty
    end

And this cop:
        def_node_matcher :extension_new, <<-PATTERN
          (:send
            (:const nil? :SketchupExtension) :new _ _)
        PATTERN

        def on_send(node)
          p node
          p extension_new(node)
        end

This will cause errors:
     Failure/Error: (:send

     NoMethodError:
       undefined method `type' for nil:NilClass

on_send is called two time in this case:
s(:send,
  s(:const, nil, :SketchupExtension), :new,
  s(:str, "Extension Name"),
  s(:send, nil, :filename))

s(:send, nil, :filename)

The error is throw in the latter.
I would have expected the second send to simply be a non-match. Not an error. Am I completely wrong here? If so, I don't understand the rationale behind the matches.

I just had a major facepalm-duh! moment.
I was mixing up the syntax which I saw when dumping a Node to string:
s(:send,
  s(:const, nil, :SketchupExtension), :new,
  s(:str, "Extension Name"),
  s(:str, "filename"))

So I used :send, :const etc in my pattern instead of send, const.
Before:
        def_node_matcher :extension_new, <<-PATTERN
          (:send
            (:const nil? :SketchupExtension) :new _ _)
        PATTERN

After:
        def_node_matcher :extension_new, <<-PATTERN
          (:send
            (:const nil? :SketchupExtension) :new _ _)
        PATTERN

So that caused some additional noise into this.  I'll go over my patterns again and see if I have done this elsewhere.
Though I still don't understand why ... could not be used in my original match but _ could.

Another question, why do :send and :const seemingly appear to work to match send and const nodes?

Another question, why do :send and :const seemingly appear to work to match send and const nodes?

I'm not sure, but we tend to use send or const instead of :send or :const.
Probably we can make it a compile error. Because :send syntax seems buggy, and we can completely replace it with send syntax.

Though I still don't understand why ... could not be used in my original match but _ could.

(:lvasgn ... (:send (:const nil?  :Foo) :new _ _)) is compiled below.
if node.type == :lvasgn && node.children.size = 2
  child = node.children[1]
  if child && child.type == :send && ...
    yield
  end
end

Namely ... does not check children size, but _ checks children size. And ... uses node.children.last, but _ uses node.children[1].
Then lvasgn has one (when a+=1) or two (when a=1) children. So when node.children.last is used, the child is a different node in both cases. For example, the child is :a when a+=1, and it is (int 1) when a=1. I think the difference is not useful n almost cases, so it should be a compile error.


Negate only one variable in a batched Ciphertext

Is there an option to negate only one variable in a batched Ciphertext?
The closest I've found is seal::util::negate_poly_coeffmod() function, but it doesn't apply for Ciphertext.
For instance in here:
Evaluator1.negate_inplace(x_CT)
if x_CT has 5 different variables, and I only wish to negate those in index 1 and 3 of the origin batched vector.
Thanks in advance!

There are two ways:

multiply with the encoding of (1, -1, 1, 1, -1, 1, ...) whose indexes 1 and 3 are negative
multiply with the encoding of (0, 1, 0, 0, 1, 0, ...) to extract indexes 1 and 3 and proceed with your operations

Worked perfectly thank you!


Preview button is broken

Expected behavior
You can save your changes after previewing.
Actual behavior
After you preview a page, the buttons on the bottom (cancel/update) are disabled and the labels are changed to 'false', 'false'
You cannot save your changes after previewing.
Steps to reproduce
Things that help:

Choose a page, any page
Hit 'Preview'
Note that you cannot save.

System configuration
Rails version: 5.2.1
CMS version: 2.0.17
Ruby version: 2.5.1p57

Closing as I can't replicate the issue. See https://github.com/comfy/comfortable-mexican-sofa/pull/857


Python v3 error: 'StdOutWrapper' object has no attribute 'flush'

When using python v3 to run locust, I occasionally get the following error with locust immediately terminating:
[2016-09-10 14:52:30,443] mybox/ERROR/stderr: Exception ignored in:
[2016-09-10 14:52:30,443] mybox/ERROR/stderr: <locust.log.StdOutWrapper object at 0x106aa79b0>
[2016-09-10 14:52:30,443] mybox/ERROR/stderr:
[2016-09-10 14:52:30,443] mybox/ERROR/stderr: AttributeError
[2016-09-10 14:52:30,443] mybox/ERROR/stderr: :
[2016-09-10 14:52:30,443] mybox/ERROR/stderr: 'StdOutWrapper' object has no attribute 'flush'
[2016-09-10 14:52:30,443] mybox/ERROR/stderr:

It looks like flushing was changed in python v3. See this SO q/a for more info.

this was fixed when we added python3 support, but it looks like it was never merged to master:
https://github.com/locustio/locust/commit/548ffe7f5e74260a50eace12469afe07acd497ca

Cherry-picked and pushed! Thanks!