GithubHelp home page GithubHelp logo

Comments (9)

parallels999 avatar parallels999 commented on August 11, 2024 1

If audit.threshold = 0, that delete should never be executed

if (($threshold = $model->getAuditThreshold()) > 0) {

unless you have the auditThreshold property on that model, on that case, this would be a duplicate of #947
public function getAuditThreshold(): int
{
return $this->auditThreshold ?? Config::get('audit.threshold', 0);
}

from laravel-auditing.

willpower232 avatar willpower232 commented on August 11, 2024

are you able to try 13.6.6 as well? are you able to share your config file?

from laravel-auditing.

giolaza avatar giolaza commented on August 11, 2024

checked 13.6.6 same problem
config file - audit.php is not published (default used)

additionally i see: log created for model in 13.6.5 is deleted for some reason

from laravel-auditing.

willpower232 avatar willpower232 commented on August 11, 2024

As per #947 this behaviour happens when the audit.threshold value is higher than 0. Is your code definitely not changing that one value at any point even if the config file isn't used? Can you output the value from php artisan tinker to confirm what it is?

from laravel-auditing.

giolaza avatar giolaza commented on August 11, 2024

image

from laravel-auditing.

giolaza avatar giolaza commented on August 11, 2024

found issue in
vendor/owen-it/laravel-auditing/src/Drivers/Database.php
here is db log:
\Illuminate\Support\Facades\DB::enableQueryLog(); $model->audits() ->latest() ->offset($threshold)->limit(PHP_INT_MAX) ->delete() > 0; $queries = \Illuminate\Support\Facades\DB::getQueryLog(); dd($queries);
delete from auditswhereaudits.auditable_type= ? andaudits.auditable_id= ? andaudits.auditable_idis not null order bycreated_at desc limit 9223372036854775807

image
image

delete method is ignoring offset method. this is reason why logs are removing("not creating")

from laravel-auditing.

giolaza avatar giolaza commented on August 11, 2024

#951

from laravel-auditing.

giolaza avatar giolaza commented on August 11, 2024

checked, forgot that in model I set limit for rows 1000000

from laravel-auditing.

erikn69 avatar erikn69 commented on August 11, 2024

Hi, test new changes on #948

from laravel-auditing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.